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

Unified Diff: mojo/shell/in_process_native_runner.h

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/shell/filename_util.cc ('k') | mojo/shell/in_process_native_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/in_process_native_runner.h
diff --git a/mojo/shell/in_process_native_runner.h b/mojo/shell/in_process_native_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..a5639f4766b6f23327466d549bce54fac3e494e2
--- /dev/null
+++ b/mojo/shell/in_process_native_runner.h
@@ -0,0 +1,67 @@
+// 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 SHELL_IN_PROCESS_NATIVE_RUNNER_H_
+#define SHELL_IN_PROCESS_NATIVE_RUNNER_H_
+
+#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 "mojo/shell/application_manager/native_runner.h"
+#include "mojo/shell/native_application_support.h"
+
+namespace mojo {
+namespace shell {
+
+class Context;
+
+// An implementation of |NativeRunner| that loads/runs the given app (from the
+// file system) on a separate thread (in the current process).
+class InProcessNativeRunner : public NativeRunner,
+ public base::DelegateSimpleThread::Delegate {
+ public:
+ explicit InProcessNativeRunner(Context* context);
+ ~InProcessNativeRunner() override;
+
+ // |NativeRunner| method:
+ void Start(const base::FilePath& app_path,
+ NativeApplicationCleanup cleanup,
+ InterfaceRequest<Application> application_request,
+ const base::Closure& app_completed_callback) override;
+
+ private:
+ // |base::DelegateSimpleThread::Delegate| method:
+ void Run() override;
+
+ base::FilePath app_path_;
+ NativeApplicationCleanup cleanup_;
+ InterfaceRequest<Application> application_request_;
+ base::Callback<bool(void)> app_completed_callback_runner_;
+
+ base::ScopedNativeLibrary app_library_;
+ scoped_ptr<base::DelegateSimpleThread> thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunner);
+};
+
+class InProcessNativeRunnerFactory : public NativeRunnerFactory {
+ public:
+ explicit InProcessNativeRunnerFactory(Context* context) : context_(context) {}
+ ~InProcessNativeRunnerFactory() override {}
+
+ scoped_ptr<NativeRunner> Create(const Options& options) override;
+
+ private:
+ Context* const context_;
+
+ DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunnerFactory);
+};
+
+} // namespace shell
+} // namespace mojo
+
+#endif // SHELL_IN_PROCESS_NATIVE_RUNNER_H_
« no previous file with comments | « mojo/shell/filename_util.cc ('k') | mojo/shell/in_process_native_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698