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

Unified Diff: mojo/shell/runner/host/out_of_process_native_runner.cc

Issue 1585493002: [mojo] Ports EDK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: mojo/shell/runner/host/out_of_process_native_runner.cc
diff --git a/mojo/shell/runner/host/out_of_process_native_runner.cc b/mojo/shell/runner/host/out_of_process_native_runner.cc
index 4b020c6d37a0889d19ff413b4f8013eb9fc00594..4c0c8bfd2ff9bf5dec31a7e5d63c7c13d0bb746d 100644
--- a/mojo/shell/runner/host/out_of_process_native_runner.cc
+++ b/mojo/shell/runner/host/out_of_process_native_runner.cc
@@ -41,12 +41,9 @@ void OutOfProcessNativeRunner::Start(
child_process_host_.reset(
new ChildProcessHost(launch_process_runner_, start_sandboxed, app_path));
- child_process_host_->Start(pid_available_callback);
-
- child_process_host_->StartApp(
- std::move(application_request),
- base::Bind(&OutOfProcessNativeRunner::AppCompleted,
- base::Unretained(this)));
+ child_process_host_->Start(base::Bind(
+ &OutOfProcessNativeRunner::OnProcessLaunched, base::Unretained(this),
+ base::Passed(&application_request), pid_available_callback));
}
void OutOfProcessNativeRunner::InitHost(
@@ -71,7 +68,19 @@ void OutOfProcessNativeRunner::AppCompleted(int32_t result) {
app_completed_callback.Run();
}
-scoped_ptr<NativeRunner> OutOfProcessNativeRunnerFactory::Create(
+void OutOfProcessNativeRunner::OnProcessLaunched(
+ InterfaceRequest<Application> application_request,
+ const base::Callback<void(base::ProcessId)>& pid_available_callback,
+ base::ProcessId pid) {
+ DCHECK(child_process_host_);
+ child_process_host_->StartApp(
+ std::move(application_request),
+ base::Bind(&OutOfProcessNativeRunner::AppCompleted,
+ base::Unretained(this)));
+ pid_available_callback.Run(pid);
+}
+
+scoped_ptr<shell::NativeRunner> OutOfProcessNativeRunnerFactory::Create(
const base::FilePath& app_path) {
return make_scoped_ptr(new OutOfProcessNativeRunner(launch_process_runner_));
}

Powered by Google App Engine
This is Rietveld 408576698