summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 15:08:15 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 15:08:15 +0000
commit8e37bf2199e37e270163eb407fab789c4ba77846 (patch)
treeead18f20b164b1475f06b250b724321df97befdf
parentbc0fab89fe50df84f74f46820bc7821df0c8235b (diff)
downloadchromium_src-8e37bf2199e37e270163eb407fab789c4ba77846.zip
chromium_src-8e37bf2199e37e270163eb407fab789c4ba77846.tar.gz
chromium_src-8e37bf2199e37e270163eb407fab789c4ba77846.tar.bz2
ThreadWatcherList: avoid re-creating a FieldTrial.
On android, ThreadWatcherList can be re-started. It should only setup FieldTrials on the first time. BUG=364265 Review URL: https://codereview.chromium.org/240953002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264790 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/metrics/thread_watcher.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc
index e3c9dfa..ab80a86 100644
--- a/chrome/browser/metrics/thread_watcher.cc
+++ b/chrome/browser/metrics/thread_watcher.cc
@@ -576,11 +576,18 @@ void ThreadWatcherList::ParseCommandLine(
return;
}
+ const char* kFieldTrialName = "ThreadWatcher";
+
+ // Nothing else to be done if the trial has already been set (i.e., when
+ // StartWatchingAll() has been already called once).
+ if (base::FieldTrialList::TrialExists(kFieldTrialName))
+ return;
+
// Set up a field trial for 100% of the users to crash if either UI or IO
// thread is not responsive for 30 seconds (or 15 pings).
scoped_refptr<base::FieldTrial> field_trial(
base::FieldTrialList::FactoryGetFieldTrial(
- "ThreadWatcher", 100, "default_hung_threads",
+ kFieldTrialName, 100, "default_hung_threads",
2014, 10, 30, base::FieldTrial::SESSION_RANDOMIZED, NULL));
int hung_thread_group = field_trial->AppendGroup("hung_thread", 100);
if (field_trial->group() == hung_thread_group) {