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

Unified Diff: content/browser/ppapi_plugin_process_host.cc

Issue 2514593002: Field trial synchronization to PPAPI process. (Closed)
Patch Set: Fix namespace. Created 4 years, 1 month 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/ppapi_plugin_process_host.h ('k') | content/ppapi_plugin/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/ppapi_plugin_process_host.cc
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 83cb49c6087e8a1094f8feb1c06ed26ddb6d3890..04595bb600d8ce3380492d3836ca18f41c93c877 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -377,6 +377,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
cmd_line->AppendSwitchASCII(switches::kProcessType,
is_broker_ ? switches::kPpapiBrokerProcess
: switches::kPpapiPluginProcess);
+ BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(cmd_line);
#if defined(OS_WIN)
cmd_line->AppendArg(is_broker_ ? switches::kPrefetchArgumentPpapiBroker
@@ -402,7 +403,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
cmd_line->CopySwitchesFrom(browser_command_line, kPluginForwardSwitches,
arraysize(kPluginForwardSwitches));
- // Copy any flash args over and introduce field trials if necessary.
+ // Copy any flash args over if necessary.
// TODO(vtl): Stop passing flash args in the command line, or windows is
// going to explode.
std::string existing_args =
@@ -479,6 +480,8 @@ bool PpapiPluginProcessHost::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(PpapiPluginProcessHost, msg)
IPC_MESSAGE_HANDLER(PpapiHostMsg_ChannelCreated,
OnRendererPluginChannelCreated)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_FieldTrialActivated,
+ OnFieldTrialActivated);
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
DCHECK(handled);
@@ -498,6 +501,14 @@ void PpapiPluginProcessHost::OnChannelConnected(int32_t peer_pid) {
pending_requests_.clear();
}
+void PpapiPluginProcessHost::OnFieldTrialActivated(
+ const std::string& trial_name) {
+ // Activate the trial in the browser process to match its state in the
+ // PPAPI process. This is done by calling FindFullName which finalizes the
+ // group and activates the trial.
+ base::FieldTrialList::FindFullName(trial_name);
+}
+
// Called when the browser <--> plugin channel has an error. This normally
// means the plugin has crashed.
void PpapiPluginProcessHost::OnChannelError() {
« no previous file with comments | « content/browser/ppapi_plugin_process_host.h ('k') | content/ppapi_plugin/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698