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

Unified Diff: base/metrics/field_trial.cc

Issue 2666653002: Record field-trial information in stability file for crash analysis. (Closed)
Patch Set: use GetActiveFieldTrialGroups instead of caching them locally 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
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());
+ }
Alexei Svitkine (slow) 2017/02/07 21:23:52 Nit: I prefer this extra logic to be inside Global
bcwhite 2017/02/07 22:09:02 It could but all the existing tracker interface op
+
global_->observer_list_->Notify(
FROM_HERE, &FieldTrialList::Observer::OnFieldTrialGroupFinalized,
field_trial->trial_name(), field_trial->group_name_internal());

Powered by Google App Engine
This is Rietveld 408576698