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

Unified Diff: mojo/shell/application_manager/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/application_manager/local_fetcher.cc ('k') | mojo/shell/application_manager/network_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/application_manager/native_runner.h
diff --git a/mojo/shell/application_manager/native_runner.h b/mojo/shell/application_manager/native_runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc62b77a6038725443db901d63cff1233b73c741
--- /dev/null
+++ b/mojo/shell/application_manager/native_runner.h
@@ -0,0 +1,58 @@
+// Copyright 2015 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_APPLICATION_MANAGER_NATIVE_RUNNER_H_
+#define SHELL_APPLICATION_MANAGER_NATIVE_RUNNER_H_
+
+#include "base/callback_forward.h"
+#include "base/memory/scoped_ptr.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/public/interfaces/application/application.mojom.h"
+#include "mojo/shell/native_application_support.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace mojo {
+namespace shell {
+
+// ApplicationManager requires implementations of NativeRunner and
+// NativeRunnerFactory to run native applications.
+class NativeRunner {
+ public:
+ virtual ~NativeRunner() {}
+
+ // Loads the app in the file at |app_path| and runs it on some other
+ // thread/process. If |cleanup| is |DELETE|, this takes ownership of the file.
+ // |app_completed_callback| is posted (to the thread on which |Start()| was
+ // called) after |MojoMain()| completes.
+ // TODO(vtl): |app_path| and |cleanup| should probably be moved to the
+ // factory's Create(). Rationale: The factory may need information from the
+ // file to decide what kind of NativeRunner to make.
+ virtual void Start(const base::FilePath& app_path,
+ NativeApplicationCleanup cleanup,
+ InterfaceRequest<Application> application_request,
+ const base::Closure& app_completed_callback) = 0;
+};
+
+class NativeRunnerFactory {
+ public:
+ // Options for running the native app. (This will contain, e.g., information
+ // about the sandbox profile, etc.)
+ struct Options {
+ // Constructs with default options.
+ Options() : force_in_process(false) {}
+
+ bool force_in_process;
+ };
+
+ virtual ~NativeRunnerFactory() {}
+ virtual scoped_ptr<NativeRunner> Create(const Options& options) = 0;
+};
+
+} // namespace shell
+} // namespace mojo
+
+#endif // SHELL_APPLICATION_MANAGER_NATIVE_RUNNER_H_
« no previous file with comments | « mojo/shell/application_manager/local_fetcher.cc ('k') | mojo/shell/application_manager/network_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698