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 #ifndef CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_ |
6 #define CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_ | 6 #define CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 30 matching lines...) Expand all Loading... |
41 // the given field trail (|field_trial_name|). This is called on UI thread. | 41 // the given field trail (|field_trial_name|). This is called on UI thread. |
42 void NotifyAllRenderers(const std::string& field_trial_name, | 42 void NotifyAllRenderers(const std::string& field_trial_name, |
43 const std::string& group_name); | 43 const std::string& group_name); |
44 | 44 |
45 // FieldTrialList::Observer methods: | 45 // FieldTrialList::Observer methods: |
46 | 46 |
47 // This method is called by the FieldTrialList singleton when a trial's group | 47 // This method is called by the FieldTrialList singleton when a trial's group |
48 // is finalized. This method contacts all renderers (by calling | 48 // is finalized. This method contacts all renderers (by calling |
49 // NotifyAllRenderers) to create a FieldTrial that carries the randomly | 49 // NotifyAllRenderers) to create a FieldTrial that carries the randomly |
50 // selected state from the browser process into all the renderer processes. | 50 // selected state from the browser process into all the renderer processes. |
51 virtual void OnFieldTrialGroupFinalized(const std::string& name, | 51 virtual void OnFieldTrialGroupFinalized( |
52 const std::string& group_name); | 52 const std::string& name, |
| 53 const std::string& group_name) OVERRIDE; |
53 | 54 |
54 private: | 55 private: |
55 // This singleton instance should be constructed during the single threaded | 56 // This singleton instance should be constructed during the single threaded |
56 // portion of main(). It initializes globals to provide support for all future | 57 // portion of main(). It initializes globals to provide support for all future |
57 // calls. This object is created on the UI thread, and it is destroyed after | 58 // calls. This object is created on the UI thread, and it is destroyed after |
58 // all the other threads have gone away. | 59 // all the other threads have gone away. |
59 static FieldTrialSynchronizer* field_trial_synchronizer_; | 60 static FieldTrialSynchronizer* field_trial_synchronizer_; |
60 | 61 |
61 DISALLOW_COPY_AND_ASSIGN(FieldTrialSynchronizer); | 62 DISALLOW_COPY_AND_ASSIGN(FieldTrialSynchronizer); |
62 }; | 63 }; |
63 | 64 |
64 #endif // CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_ | 65 #endif // CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_ |
OLD | NEW |