OLD | NEW |
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 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_HTTP_HEADER_PROVIDER_H_ | 5 #ifndef COMPONENTS_VARIATIONS_VARIATIONS_HTTP_HEADER_PROVIDER_H_ |
6 #define CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_HTTP_HEADER_PROVIDER_H_ | 6 #define COMPONENTS_VARIATIONS_VARIATIONS_HTTP_HEADER_PROVIDER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
15 #include "components/variations/variations_associated_data.h" | 15 #include "components/variations/variations_associated_data.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class ResourceContext; | 18 class ResourceContext; |
19 } | 19 } |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 class HttpRequestHeaders; | 22 class HttpRequestHeaders; |
23 } | 23 } |
24 | 24 |
25 class GURL; | 25 class GURL; |
26 class Profile; | |
27 class ProfileIOData; | |
28 | 26 |
29 template <typename T> struct DefaultSingletonTraits; | 27 template <typename T> struct DefaultSingletonTraits; |
30 | 28 |
31 namespace chrome_variations { | 29 namespace variations { |
32 | 30 |
33 // A helper class for maintaining Chrome experiments and metrics state | 31 // A helper class for maintaining Chrome experiments and metrics state |
34 // transmitted in custom HTTP request headers. | 32 // transmitted in custom HTTP request headers. |
35 // This class is a thread-safe singleton. | 33 // This class is a thread-safe singleton. |
36 class VariationsHttpHeaderProvider : base::FieldTrialList::Observer { | 34 class VariationsHttpHeaderProvider : base::FieldTrialList::Observer { |
37 public: | 35 public: |
38 static VariationsHttpHeaderProvider* GetInstance(); | 36 static VariationsHttpHeaderProvider* GetInstance(); |
39 | 37 |
40 // Adds Chrome experiment and metrics state as custom headers to |headers|. | 38 // Adds Chrome experiment and metrics state as custom headers to |headers|. |
41 // Some headers may not be set given the |incognito| mode or whether | 39 // Some headers may not be set given the |incognito| mode or whether |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 101 |
104 // Provides the google experiment ids forced from command line. | 102 // Provides the google experiment ids forced from command line. |
105 std::set<chrome_variations::VariationID> default_variation_ids_set_; | 103 std::set<chrome_variations::VariationID> default_variation_ids_set_; |
106 std::set<chrome_variations::VariationID> default_trigger_id_set_; | 104 std::set<chrome_variations::VariationID> default_trigger_id_set_; |
107 | 105 |
108 std::string variation_ids_header_; | 106 std::string variation_ids_header_; |
109 | 107 |
110 DISALLOW_COPY_AND_ASSIGN(VariationsHttpHeaderProvider); | 108 DISALLOW_COPY_AND_ASSIGN(VariationsHttpHeaderProvider); |
111 }; | 109 }; |
112 | 110 |
113 } // namespace chrome_variations | 111 } // namespace variations |
114 | 112 |
115 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_HTTP_HEADER_PROVIDER_H_ | 113 #endif // COMPONENTS_VARIATIONS_VARIATIONS_HTTP_HEADER_PROVIDER_H_ |
OLD | NEW |