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

Unified Diff: content/browser/child_process_launcher.cc

Issue 2365273004: Initial implementation for sharing field trial state (win) (Closed)
Patch Set: Fix unit test and remove macro Created 4 years, 2 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..88185adfcb54cedb151c1ce3ecb5a7b0420d1e1d 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -121,6 +121,7 @@ void LaunchOnLauncherThread(const NotifyCallback& callback,
#if defined(OS_ANDROID)
base::ScopedFD ipcfd,
#endif
+ const base::SharedMemory* field_trial_state,
mojo::edk::ScopedPlatformHandle client_handle,
base::CommandLine* cmd_line) {
DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER);
@@ -152,6 +153,8 @@ void LaunchOnLauncherThread(const NotifyCallback& callback,
} else {
base::HandlesToInheritVector handles;
handles.push_back(client_handle.get().handle);
+ if (field_trial_state)
+ handles.push_back(field_trial_state->handle().GetHandle());
cmd_line->AppendSwitchASCII(
mojo::edk::PlatformChannelPair::kMojoPlatformChannelHandleSwitch,
base::UintToString(base::win::HandleToUint32(handles[0])));
@@ -394,6 +397,7 @@ ChildProcessLauncher::ChildProcessLauncher(
base::CommandLine* cmd_line,
int child_process_id,
Client* client,
+ const base::SharedMemory* field_trial_state,
const std::string& mojo_child_token,
const mojo::edk::ProcessErrorCallback& process_error_callback,
bool terminate_on_shutdown)
@@ -414,7 +418,7 @@ ChildProcessLauncher::ChildProcessLauncher(
weak_factory_(this) {
DCHECK(CalledOnValidThread());
CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_));
- Launch(delegate, cmd_line, child_process_id);
+ Launch(delegate, cmd_line, child_process_id, field_trial_state);
}
ChildProcessLauncher::~ChildProcessLauncher() {
@@ -428,10 +432,10 @@ ChildProcessLauncher::~ChildProcessLauncher() {
}
}
-void ChildProcessLauncher::Launch(
- SandboxedProcessLauncherDelegate* delegate,
- base::CommandLine* cmd_line,
- int child_process_id) {
+void ChildProcessLauncher::Launch(SandboxedProcessLauncherDelegate* delegate,
+ base::CommandLine* cmd_line,
+ int child_process_id,
+ const base::SharedMemory* field_trial_state) {
DCHECK(CalledOnValidThread());
#if defined(OS_ANDROID)
@@ -480,7 +484,7 @@ void ChildProcessLauncher::Launch(
#if defined(OS_ANDROID)
base::Passed(&ipcfd),
#endif
- base::Passed(&client_handle), cmd_line));
+ field_trial_state, base::Passed(&client_handle), cmd_line));
}
void ChildProcessLauncher::UpdateTerminationStatus(bool known_dead) {

Powered by Google App Engine
This is Rietveld 408576698