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

Unified Diff: content/browser/child_process_launcher.cc

Issue 2365273004: Initial implementation for sharing field trial state (win) (Closed)
Patch Set: rebase + gclient sync 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
« no previous file with comments | « content/browser/child_process_launcher.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/child_process_launcher.cc
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index 0d640fae6ab95d3e10951a73f1b615b1a849df03..82d6744b8dc98e829a2b314c55d8fccd781887f8 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])));
@@ -397,6 +400,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)
@@ -417,7 +421,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() {
@@ -431,10 +435,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)
@@ -483,7 +487,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) {
« no previous file with comments | « content/browser/child_process_launcher.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698