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

Unified Diff: shell/in_process_dynamic_service_runner.h

Issue 974403002: Add --force-in-process flag to shell. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: amend comment Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: shell/in_process_dynamic_service_runner.h
diff --git a/shell/in_process_dynamic_service_runner.h b/shell/in_process_dynamic_service_runner.h
index 3394921dbb1c8116f4a2fe2f2dfffdeb6b8d4d59..3d23613633f656a153c8d96de3cd5f6da1eb84b7 100644
--- a/shell/in_process_dynamic_service_runner.h
+++ b/shell/in_process_dynamic_service_runner.h
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "base/scoped_native_library.h"
#include "base/threading/simple_thread.h"
#include "shell/application_manager/application_manager.h"
@@ -16,10 +17,13 @@
namespace mojo {
namespace shell {
+class Context;
+
+// TODO(vtl): Rename this to "InProcessNativeRunner".
// An implementation of |DynamicServiceRunner| that loads/runs the given app
// (from the file system) on a separate thread (in the current process).
class InProcessDynamicServiceRunner
- : public mojo::NativeRunner,
+ : public NativeRunner,
public base::DelegateSimpleThread::Delegate {
public:
explicit InProcessDynamicServiceRunner(Context* context);
@@ -27,7 +31,7 @@ class InProcessDynamicServiceRunner
// |DynamicServiceRunner| method:
void Start(const base::FilePath& app_path,
- mojo::NativeRunner::CleanupBehavior cleanup_behavior,
+ NativeRunner::CleanupBehavior cleanup_behavior,
InterfaceRequest<Application> application_request,
const base::Closure& app_completed_callback) override;
@@ -36,7 +40,7 @@ class InProcessDynamicServiceRunner
void Run() override;
base::FilePath app_path_;
- mojo::NativeRunner::CleanupBehavior cleanup_behavior_;
+ NativeRunner::CleanupBehavior cleanup_behavior_;
InterfaceRequest<Application> application_request_;
base::Callback<bool(void)> app_completed_callback_runner_;
@@ -46,8 +50,19 @@ class InProcessDynamicServiceRunner
DISALLOW_COPY_AND_ASSIGN(InProcessDynamicServiceRunner);
};
-typedef DynamicServiceRunnerFactoryImpl<InProcessDynamicServiceRunner>
- InProcessDynamicServiceRunnerFactory;
+class InProcessDynamicServiceRunnerFactory : public NativeRunnerFactory {
+ public:
+ explicit InProcessDynamicServiceRunnerFactory(Context* context)
+ : context_(context) {}
+ ~InProcessDynamicServiceRunnerFactory() override {}
+
+ scoped_ptr<NativeRunner> Create(const Options& options) override;
+
+ private:
+ Context* const context_;
+
+ DISALLOW_COPY_AND_ASSIGN(InProcessDynamicServiceRunnerFactory);
+};
} // namespace shell
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698