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

Unified Diff: content/browser/child_process_launcher.cc

Issue 2365273004: Initial implementation for sharing field trial state (win) (Closed)
Patch Set: Write unit test for BrowserChildProcessHostImpl Created 4 years, 3 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.cc
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index 5a655368aa8bac219446a3ea3586a4c7b6eb7666..1fe1086107685d3166b0edd9fede34a4800e5418 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -121,6 +121,9 @@ void LaunchOnLauncherThread(const NotifyCallback& callback,
#if defined(OS_ANDROID)
base::ScopedFD ipcfd,
#endif
+#if defined(OS_WIN)
+ HANDLE field_trial_handle,
+#endif
mojo::edk::ScopedPlatformHandle client_handle,
base::CommandLine* cmd_line) {
DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER);
@@ -152,9 +155,12 @@ void LaunchOnLauncherThread(const NotifyCallback& callback,
} else {
base::HandlesToInheritVector handles;
handles.push_back(client_handle.get().handle);
+ if (field_trial_handle)
+ handles.push_back(field_trial_handle);
cmd_line->AppendSwitchASCII(
mojo::edk::PlatformChannelPair::kMojoPlatformChannelHandleSwitch,
base::UintToString(base::win::HandleToUint32(handles[0])));
+
launch_result =
StartSandboxedProcess(delegate, cmd_line, handles, &process);
}
@@ -391,6 +397,9 @@ void SetProcessBackgroundedOnLauncherThread(base::Process process,
ChildProcessLauncher::ChildProcessLauncher(
SandboxedProcessLauncherDelegate* delegate,
+#if defined(OS_WIN)
+ HANDLE field_trial_handle,
+#endif
base::CommandLine* cmd_line,
int child_process_id,
Client* client,
@@ -414,7 +423,11 @@ ChildProcessLauncher::ChildProcessLauncher(
weak_factory_(this) {
DCHECK(CalledOnValidThread());
CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_));
+#if defined(OS_WIN)
+ Launch(delegate, field_trial_handle, cmd_line, child_process_id);
+#else
Launch(delegate, cmd_line, child_process_id);
+#endif
}
ChildProcessLauncher::~ChildProcessLauncher() {
@@ -430,6 +443,9 @@ ChildProcessLauncher::~ChildProcessLauncher() {
void ChildProcessLauncher::Launch(
SandboxedProcessLauncherDelegate* delegate,
+#if defined(OS_WIN)
+ HANDLE field_trial_handle,
+#endif
base::CommandLine* cmd_line,
int child_process_id) {
DCHECK(CalledOnValidThread());
@@ -480,6 +496,9 @@ void ChildProcessLauncher::Launch(
#if defined(OS_ANDROID)
base::Passed(&ipcfd),
#endif
+#if defined(OS_WIN)
+ field_trial_handle,
+#endif
base::Passed(&client_handle), cmd_line));
}

Powered by Google App Engine
This is Rietveld 408576698