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

Unified Diff: content/browser/child_process_launcher_helper_android.cc

Issue 2686983003: Avoid a thread hop when initializing IPC to new processes (Closed)
Patch Set: . Created 3 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: content/browser/child_process_launcher_helper_android.cc
diff --git a/content/browser/child_process_launcher_helper_android.cc b/content/browser/child_process_launcher_helper_android.cc
index 5a241753ea9c867916810b264c6c052a99f2d7c6..1ff084e6fe7ee7c0877385b4ca06d233cf53abac 100644
--- a/content/browser/child_process_launcher_helper_android.cc
+++ b/content/browser/child_process_launcher_helper_android.cc
@@ -28,7 +28,9 @@ namespace {
void ChildProcessStartedCallback(
ChildProcessLauncherHelper* helper,
base::ProcessHandle handle,
- int launch_result) {
+ int launch_result,
+ std::unique_ptr<mojo::edk::PendingProcessConnection> pending_connection,
+ mojo::edk::ScopedPlatformHandle server_handle) {
// TODO(jcivelli): Remove this by defining better what happens on what thread
// in the corresponding Java code.
ChildProcessLauncherHelper::Process process;
@@ -52,7 +54,9 @@ void ChildProcessStartedCallback(
if (on_client_thread) {
ChildProcessLauncherHelper::Process process;
process.process = base::Process(handle);
- helper->PostLaunchOnClientThread(std::move(process), launch_result);
+ helper->PostLaunchOnClientThread(std::move(process), launch_result,
+ std::move(pending_connection),
+ std::move(server_handle));
}
}
@@ -130,14 +134,16 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThread(
const base::LaunchOptions& options,
std::unique_ptr<FileDescriptorInfo> files_to_register,
bool* is_synchronous_launch,
- int* launch_result) {
+ int* launch_result,
+ std::unique_ptr<mojo::edk::PendingProcessConnection>* pending_connection,
+ mojo::edk::ScopedPlatformHandle* server_handle) {
*is_synchronous_launch = false;
- StartChildProcess(command_line()->argv(),
- child_process_id(),
+ StartChildProcess(command_line()->argv(), child_process_id(),
files_to_register.get(),
- base::Bind(&ChildProcessStartedCallback,
- RetainedRef(this)));
+ base::Bind(&ChildProcessStartedCallback, RetainedRef(this),
+ base::Passed(pending_connection),
+ base::Passed(server_handle)));
return Process();
}
« no previous file with comments | « content/browser/child_process_launcher_helper.cc ('k') | content/browser/child_process_launcher_helper_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698