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

Unified Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 700953002: Send all field trials from the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@finch4
Patch Set: Responded to comments. Created 6 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
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..d0ed608f3c9d8ed0b2fd03424ec8b4e6fe161b6f 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();
+ // Report any field trials activations to the browser.
Alexei Svitkine (slow) 2014/11/05 22:50:53 Nit: I would make the comment say "// Listen for f
Georges Khalil 2014/11/06 18:36:28 Done.
+ 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, group_name));
+}

Powered by Google App Engine
This is Rietveld 408576698