forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathout_of_process_dynamic_service_runner.h
53 lines (40 loc) · 1.71 KB
/
out_of_process_dynamic_service_runner.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MOJO_SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_
#define MOJO_SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/macros.h"
#include "mojo/shell/app_child_process.mojom.h"
#include "mojo/shell/app_child_process_host.h"
#include "mojo/shell/dynamic_service_runner.h"
namespace mojo {
namespace shell {
// An implementation of |DynamicServiceRunner| that loads/runs the given app
// (from the file system) in a separate process (of its own).
class OutOfProcessDynamicServiceRunner
: public DynamicServiceRunner,
public AppChildControllerClient {
public:
explicit OutOfProcessDynamicServiceRunner(Context* context);
virtual ~OutOfProcessDynamicServiceRunner();
// |DynamicServiceRunner| method:
virtual void Start(const base::FilePath& app_path,
ScopedMessagePipeHandle service_handle,
const base::Closure& app_completed_callback) override;
private:
// |AppChildControllerClient| method:
virtual void AppCompleted(int32_t result) override;
Context* const context_;
base::FilePath app_path_;
ScopedMessagePipeHandle service_handle_;
base::Closure app_completed_callback_;
scoped_ptr<AppChildProcessHost> app_child_process_host_;
DISALLOW_COPY_AND_ASSIGN(OutOfProcessDynamicServiceRunner);
};
typedef DynamicServiceRunnerFactoryImpl<OutOfProcessDynamicServiceRunner>
OutOfProcessDynamicServiceRunnerFactory;
} // namespace shell
} // namespace mojo
#endif // MOJO_SHELL_OUT_OF_PROCESS_DYNAMIC_SERVICE_RUNNER_H_