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

Unified Diff: mojo/shell/out_of_process_native_runner.cc

Issue 1091513005: Separate mojo/shell into a runner and the application manager (shell) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 8 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/out_of_process_native_runner.h ('k') | mojo/shell/query_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/out_of_process_native_runner.cc
diff --git a/mojo/shell/out_of_process_native_runner.cc b/mojo/shell/out_of_process_native_runner.cc
deleted file mode 100644
index f09ea829d004e23441e71b8ace1f3c59d27291c7..0000000000000000000000000000000000000000
--- a/mojo/shell/out_of_process_native_runner.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// 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.
-
-#include "mojo/shell/out_of_process_native_runner.h"
-
-#include "base/bind.h"
-#include "base/callback_helpers.h"
-#include "base/files/file_util.h"
-#include "base/logging.h"
-#include "mojo/shell/child_process.mojom.h"
-#include "mojo/shell/child_process_host.h"
-#include "mojo/shell/in_process_native_runner.h"
-
-namespace mojo {
-namespace shell {
-
-OutOfProcessNativeRunner::OutOfProcessNativeRunner(Context* context)
- : context_(context) {
-}
-
-OutOfProcessNativeRunner::~OutOfProcessNativeRunner() {
- if (child_process_host_) {
- // TODO(vtl): Race condition: If |ChildProcessHost::DidStart()| hasn't been
- // called yet, we shouldn't call |Join()| here. (Until |DidStart()|, we may
- // not have a child process to wait on.) Probably we should fix |Join()|.
- child_process_host_->Join();
- }
-}
-
-void OutOfProcessNativeRunner::Start(
- const base::FilePath& app_path,
- NativeApplicationCleanup cleanup,
- InterfaceRequest<Application> application_request,
- const base::Closure& app_completed_callback) {
- app_path_ = app_path;
-
- DCHECK(app_completed_callback_.is_null());
- app_completed_callback_ = app_completed_callback;
-
- std::string name = app_path.BaseName().RemoveExtension().MaybeAsASCII();
- child_process_host_.reset(new ChildProcessHost(context_, name));
- child_process_host_->Start();
-
- // TODO(vtl): |app_path.AsUTF8Unsafe()| is unsafe.
- child_process_host_->StartApp(
- app_path.AsUTF8Unsafe(), cleanup == NativeApplicationCleanup::DELETE,
- application_request.Pass(),
- base::Bind(&OutOfProcessNativeRunner::AppCompleted,
- base::Unretained(this)));
-}
-
-void OutOfProcessNativeRunner::AppCompleted(int32_t result) {
- DVLOG(2) << "OutOfProcessNativeRunner::AppCompleted(" << result << ")";
-
- child_process_host_.reset();
- // This object may be deleted by this callback.
- base::Closure app_completed_callback = app_completed_callback_;
- app_completed_callback_.Reset();
- app_completed_callback.Run();
-}
-
-scoped_ptr<NativeRunner> OutOfProcessNativeRunnerFactory::Create(
- const Options& options) {
- if (options.force_in_process)
- return make_scoped_ptr(new InProcessNativeRunner(context_));
-
- return make_scoped_ptr(new OutOfProcessNativeRunner(context_));
-}
-
-} // namespace shell
-} // namespace mojo
« no previous file with comments | « mojo/shell/out_of_process_native_runner.h ('k') | mojo/shell/query_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698