| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 8 #include "base/logging.h" |
| 8 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 9 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
| 10 #include "chrome/common/render_messages.h" | 11 #include "chrome/common/render_messages.h" |
| 11 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/render_process_host.h" | 13 #include "content/public/browser/render_process_host.h" |
| 13 | 14 |
| 14 using content::BrowserThread; | 15 using content::BrowserThread; |
| 15 | 16 |
| 16 FieldTrialSynchronizer::FieldTrialSynchronizer() { | 17 FieldTrialSynchronizer::FieldTrialSynchronizer() { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 37 it.GetCurrentValue()->Send( | 38 it.GetCurrentValue()->Send( |
| 38 new ChromeViewMsg_SetFieldTrialGroup(field_trial_name, group_name)); | 39 new ChromeViewMsg_SetFieldTrialGroup(field_trial_name, group_name)); |
| 39 } | 40 } |
| 40 } | 41 } |
| 41 | 42 |
| 42 void FieldTrialSynchronizer::OnFieldTrialGroupFinalized( | 43 void FieldTrialSynchronizer::OnFieldTrialGroupFinalized( |
| 43 const std::string& field_trial_name, | 44 const std::string& field_trial_name, |
| 44 const std::string& group_name) { | 45 const std::string& group_name) { |
| 45 BrowserThread::PostTask( | 46 BrowserThread::PostTask( |
| 46 BrowserThread::UI, FROM_HERE, | 47 BrowserThread::UI, FROM_HERE, |
| 47 NewRunnableMethod(this, | 48 base::Bind(&FieldTrialSynchronizer::NotifyAllRenderers, |
| 48 &FieldTrialSynchronizer::NotifyAllRenderers, | 49 this, |
| 49 field_trial_name, | 50 field_trial_name, |
| 50 group_name)); | 51 group_name)); |
| 51 } | 52 } |
| 52 | 53 |
| 53 // static | 54 // static |
| 54 FieldTrialSynchronizer* | 55 FieldTrialSynchronizer* |
| 55 FieldTrialSynchronizer::field_trial_synchronizer_ = NULL; | 56 FieldTrialSynchronizer::field_trial_synchronizer_ = NULL; |
| OLD | NEW |