Index: chrome/renderer/chrome_render_process_observer.cc |
diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc |
index ad3ab00752622ce4fcea20b1507a76a41ad8bb7e..73af7a8f0e9e7e2667be791a87e0aa1f3e7291ff 100644 |
--- a/chrome/renderer/chrome_render_process_observer.cc |
+++ b/chrome/renderer/chrome_render_process_observer.cc |
@@ -299,6 +299,8 @@ ChromeRenderProcessObserver::ChromeRenderProcessObserver( |
#endif |
// Setup initial set of crash dump data for Field Trials in this renderer. |
chrome_variations::SetChildProcessLoggingVariationList(); |
+ // Listen for field trial activations to report them to the browser. |
+ base::FieldTrialList::AddObserver(this); |
} |
ChromeRenderProcessObserver::~ChromeRenderProcessObserver() { |
@@ -365,8 +367,8 @@ void ChromeRenderProcessObserver::OnSetFieldTrialGroup( |
base::FieldTrialList::CreateFieldTrial(field_trial_name, group_name); |
// TODO(mef): Remove this check after the investigation of 359406 is complete. |
CHECK(trial) << field_trial_name << ":" << group_name; |
- // Ensure the trial is marked as "used" by calling group() on it. This is |
- // needed to ensure the trial is properly reported in renderer crash reports. |
+ // Ensure the trial is marked as "used" by calling group() on it if it is |
+ // marked as activated. |
trial->group(); |
chrome_variations::SetChildProcessLoggingVariationList(); |
} |
@@ -379,3 +381,10 @@ const RendererContentSettingRules* |
ChromeRenderProcessObserver::content_setting_rules() const { |
return &content_setting_rules_; |
} |
+ |
+void ChromeRenderProcessObserver::OnFieldTrialGroupFinalized( |
+ const std::string& trial_name, |
+ const std::string& group_name) { |
+ content::RenderThread::Get()->Send( |
+ new ChromeViewHostMsg_FieldTrialActivated(trial_name)); |
+} |