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

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 5 years, 11 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: 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 2e8d4ee943222e3cdde1413f7337a536e2eb30a5..860dd326207efef5a7acdff9ab69120b9d48e066 100644
--- a/chrome/renderer/chrome_render_process_observer.cc
+++ b/chrome/renderer/chrome_render_process_observer.cc
@@ -305,6 +305,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() {
@@ -371,8 +373,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();
}
@@ -385,3 +387,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));
+}
« no previous file with comments | « chrome/renderer/chrome_render_process_observer.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698