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

Unified Diff: base/metrics/field_trial.cc

Issue 2666653002: Record field-trial information in stability file for crash analysis. (Closed)
Patch Set: use c++ loop format Created 3 years, 10 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 | « base/debug/activity_tracker.cc ('k') | chrome/browser/chrome_browser_field_trials_desktop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/field_trial.cc
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc
index 75832654facebcfa48b91c3fcdffd6caf8a44aa9..d16d79f2455243a9dd77887aac7ef07b77d7a7ef 100644
--- a/base/metrics/field_trial.cc
+++ b/base/metrics/field_trial.cc
@@ -10,6 +10,7 @@
#include "base/base_switches.h"
#include "base/build_time.h"
#include "base/command_line.h"
+#include "base/debug/activity_tracker.h"
#include "base/logging.h"
#include "base/metrics/field_trial_param_associator.h"
#include "base/process/memory.h"
@@ -982,6 +983,15 @@ void FieldTrialList::NotifyFieldTrialGroupSelection(FieldTrial* field_trial) {
ActivateFieldTrialEntryWhileLocked(field_trial);
}
+ // Recording for stability debugging has to be done inline as a task posted
+ // to an observer may not get executed before a crash.
+ base::debug::GlobalActivityTracker* tracker =
+ base::debug::GlobalActivityTracker::Get();
+ if (tracker) {
+ tracker->RecordFieldTrial(field_trial->trial_name(),
+ field_trial->group_name_internal());
+ }
+
global_->observer_list_->Notify(
FROM_HERE, &FieldTrialList::Observer::OnFieldTrialGroupFinalized,
field_trial->trial_name(), field_trial->group_name_internal());
« no previous file with comments | « base/debug/activity_tracker.cc ('k') | chrome/browser/chrome_browser_field_trials_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698