Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: shell/in_process_dynamic_service_runner.h

Issue 981733002: Rename {In,OutOf}ProcessDynamicServiceRunner -> ...NativeRunner. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: remove incorrect/flaky NOTREACHED() Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « shell/dynamic_service_runner.cc ('k') | shell/in_process_dynamic_service_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef SHELL_IN_PROCESS_DYNAMIC_SERVICE_RUNNER_H_
6 #define SHELL_IN_PROCESS_DYNAMIC_SERVICE_RUNNER_H_
7
8 #include "base/callback.h"
9 #include "base/files/file_path.h"
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/scoped_native_library.h"
13 #include "base/threading/simple_thread.h"
14 #include "shell/application_manager/application_manager.h"
15 #include "shell/dynamic_service_runner.h"
16
17 namespace mojo {
18 namespace shell {
19
20 class Context;
21
22 // TODO(vtl): Rename this to "InProcessNativeRunner".
23 // An implementation of |DynamicServiceRunner| that loads/runs the given app
24 // (from the file system) on a separate thread (in the current process).
25 class InProcessDynamicServiceRunner
26 : public NativeRunner,
27 public base::DelegateSimpleThread::Delegate {
28 public:
29 explicit InProcessDynamicServiceRunner(Context* context);
30 ~InProcessDynamicServiceRunner() override;
31
32 // |DynamicServiceRunner| method:
33 void Start(const base::FilePath& app_path,
34 NativeRunner::CleanupBehavior cleanup_behavior,
35 InterfaceRequest<Application> application_request,
36 const base::Closure& app_completed_callback) override;
37
38 private:
39 // |base::DelegateSimpleThread::Delegate| method:
40 void Run() override;
41
42 base::FilePath app_path_;
43 NativeRunner::CleanupBehavior cleanup_behavior_;
44 InterfaceRequest<Application> application_request_;
45 base::Callback<bool(void)> app_completed_callback_runner_;
46
47 base::ScopedNativeLibrary app_library_;
48 scoped_ptr<base::DelegateSimpleThread> thread_;
49
50 DISALLOW_COPY_AND_ASSIGN(InProcessDynamicServiceRunner);
51 };
52
53 class InProcessDynamicServiceRunnerFactory : public NativeRunnerFactory {
54 public:
55 explicit InProcessDynamicServiceRunnerFactory(Context* context)
56 : context_(context) {}
57 ~InProcessDynamicServiceRunnerFactory() override {}
58
59 scoped_ptr<NativeRunner> Create(const Options& options) override;
60
61 private:
62 Context* const context_;
63
64 DISALLOW_COPY_AND_ASSIGN(InProcessDynamicServiceRunnerFactory);
65 };
66
67 } // namespace shell
68 } // namespace mojo
69
70 #endif // SHELL_IN_PROCESS_DYNAMIC_SERVICE_RUNNER_H_
OLDNEW
« no previous file with comments | « shell/dynamic_service_runner.cc ('k') | shell/in_process_dynamic_service_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698