Add a string for translation.
[chromium-blink-merge.git] / mojo / shell / out_of_process_dynamic_service_runner.h
blobbee4e19446a2051554db417d41ed91f916e02866
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MOJO_SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_
6 #define MOJO_SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_
8 #include "base/callback.h"
9 #include "base/files/file_path.h"
10 #include "base/macros.h"
11 #include "mojo/shell/app_child_process.mojom.h"
12 #include "mojo/shell/app_child_process_host.h"
13 #include "mojo/shell/dynamic_service_runner.h"
15 namespace mojo {
16 namespace shell {
18 // An implementation of |DynamicServiceRunner| that loads/runs the given app
19 // (from the file system) in a separate process (of its own).
20 class OutOfProcessDynamicServiceRunner
21 : public DynamicServiceRunner,
22 public mojo_shell::AppChildControllerClient {
23 public:
24 explicit OutOfProcessDynamicServiceRunner(Context* context);
25 virtual ~OutOfProcessDynamicServiceRunner();
27 // |DynamicServiceRunner| method:
28 virtual void Start(const base::FilePath& app_path,
29 ScopedShellHandle service_handle,
30 const base::Closure& app_completed_callback) OVERRIDE;
32 private:
33 // |mojo_shell::AppChildControllerClient| method:
34 virtual void AppCompleted(int32_t result) OVERRIDE;
36 Context* const context_;
38 base::FilePath app_path_;
39 ScopedShellHandle service_handle_;
40 base::Closure app_completed_callback_;
42 scoped_ptr<AppChildProcessHost> app_child_process_host_;
44 DISALLOW_COPY_AND_ASSIGN(OutOfProcessDynamicServiceRunner);
47 typedef DynamicServiceRunnerFactoryImpl<OutOfProcessDynamicServiceRunner>
48 OutOfProcessDynamicServiceRunnerFactory;
50 } // namespace shell
51 } // namespace mojo
53 #endif // MOJO_SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_