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

Side by Side Diff: chrome/browser/metrics/field_trial_synchronizer.cc

Issue 10165014: Add and implement API to associate Google experiment IDs with FieldTrials. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: added time variable Created 8 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/metrics/field_trial.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/metrics/field_trial_synchronizer.h" 5 #include "chrome/browser/metrics/field_trial_synchronizer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
11 #include "chrome/common/metrics/experiments_helper.h" 11 #include "chrome/common/metrics/experiments_helper.h"
12 #include "chrome/common/render_messages.h" 12 #include "chrome/common/render_messages.h"
13 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
14 #include "content/public/browser/render_process_host.h" 14 #include "content/public/browser/render_process_host.h"
15 15
16 using content::BrowserThread; 16 using content::BrowserThread;
17 17
18 FieldTrialSynchronizer::FieldTrialSynchronizer() { 18 FieldTrialSynchronizer::FieldTrialSynchronizer() {
19 DCHECK(field_trial_synchronizer_ == NULL); 19 DCHECK(field_trial_synchronizer_ == NULL);
20 field_trial_synchronizer_ = this; 20 field_trial_synchronizer_ = this;
21 base::FieldTrialList::AddObserver(this); 21 base::FieldTrialList::AddObserver(this);
22 22
23 ExperimentsHelper::SetChildProcessLoggingExperimentList(); 23 experiments_helper::SetChildProcessLoggingExperimentList();
24 } 24 }
25 25
26 FieldTrialSynchronizer::~FieldTrialSynchronizer() { 26 FieldTrialSynchronizer::~FieldTrialSynchronizer() {
27 base::FieldTrialList::RemoveObserver(this); 27 base::FieldTrialList::RemoveObserver(this);
28 field_trial_synchronizer_ = NULL; 28 field_trial_synchronizer_ = NULL;
29 } 29 }
30 30
31 void FieldTrialSynchronizer::NotifyAllRenderers( 31 void FieldTrialSynchronizer::NotifyAllRenderers(
32 const std::string& field_trial_name, 32 const std::string& field_trial_name,
33 const std::string& group_name) { 33 const std::string& group_name) {
(...skipping 11 matching lines...) Expand all
45 45
46 void FieldTrialSynchronizer::OnFieldTrialGroupFinalized( 46 void FieldTrialSynchronizer::OnFieldTrialGroupFinalized(
47 const std::string& field_trial_name, 47 const std::string& field_trial_name,
48 const std::string& group_name) { 48 const std::string& group_name) {
49 BrowserThread::PostTask( 49 BrowserThread::PostTask(
50 BrowserThread::UI, FROM_HERE, 50 BrowserThread::UI, FROM_HERE,
51 base::Bind(&FieldTrialSynchronizer::NotifyAllRenderers, 51 base::Bind(&FieldTrialSynchronizer::NotifyAllRenderers,
52 this, 52 this,
53 field_trial_name, 53 field_trial_name,
54 group_name)); 54 group_name));
55 ExperimentsHelper::SetChildProcessLoggingExperimentList(); 55 experiments_helper::SetChildProcessLoggingExperimentList();
56 } 56 }
57 57
58 // static 58 // static
59 FieldTrialSynchronizer* 59 FieldTrialSynchronizer*
60 FieldTrialSynchronizer::field_trial_synchronizer_ = NULL; 60 FieldTrialSynchronizer::field_trial_synchronizer_ = NULL;
OLDNEW
« no previous file with comments | « base/metrics/field_trial.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698