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 #include "chrome/browser/chrome_browser_field_trials.h" | 5 #include "chrome/browser/chrome_browser_field_trials.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 base::GlobalHistogramAllocator::Get(); | 103 base::GlobalHistogramAllocator::Get(); |
104 UMA_HISTOGRAM_ENUMERATION("UMA.PersistentHistograms.InitResult", | 104 UMA_HISTOGRAM_ENUMERATION("UMA.PersistentHistograms.InitResult", |
105 result + (allocator ? 0 : 1), | 105 result + (allocator ? 0 : 1), |
106 CREATE_ALLOCATOR_RESULTS); | 106 CREATE_ALLOCATOR_RESULTS); |
107 if (!allocator) | 107 if (!allocator) |
108 return; | 108 return; |
109 | 109 |
110 // Create tracking histograms for the allocator and record storage file. | 110 // Create tracking histograms for the allocator and record storage file. |
111 allocator->CreateTrackingHistograms( | 111 allocator->CreateTrackingHistograms( |
112 ChromeMetricsServiceClient::kBrowserMetricsName); | 112 ChromeMetricsServiceClient::kBrowserMetricsName); |
113 allocator->SetPersistentLocation(active_file); | |
114 } | 113 } |
115 | 114 |
116 // Create a field trial to control metrics/crash sampling for Stable on | 115 // Create a field trial to control metrics/crash sampling for Stable on |
117 // Windows/Android if no variations seed was applied. | 116 // Windows/Android if no variations seed was applied. |
118 void CreateFallbackSamplingTrialIfNeeded(bool has_seed, | 117 void CreateFallbackSamplingTrialIfNeeded(bool has_seed, |
119 base::FeatureList* feature_list) { | 118 base::FeatureList* feature_list) { |
120 #if defined(OS_WIN) || defined(OS_ANDROID) | 119 #if defined(OS_WIN) || defined(OS_ANDROID) |
121 // Only create the fallback trial if there isn't already a variations seed | 120 // Only create the fallback trial if there isn't already a variations seed |
122 // being applied. This should occur during first run when first-run variations | 121 // being applied. This should occur during first run when first-run variations |
123 // isn't supported. It's assumed that, if there is a seed, then it either | 122 // isn't supported. It's assumed that, if there is a seed, then it either |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 bool has_seed, | 155 bool has_seed, |
157 base::FeatureList* feature_list) { | 156 base::FeatureList* feature_list) { |
158 CreateFallbackSamplingTrialIfNeeded(has_seed, feature_list); | 157 CreateFallbackSamplingTrialIfNeeded(has_seed, feature_list); |
159 } | 158 } |
160 | 159 |
161 void ChromeBrowserFieldTrials::InstantiateDynamicTrials() { | 160 void ChromeBrowserFieldTrials::InstantiateDynamicTrials() { |
162 // Persistent histograms must be enabled as soon as possible. | 161 // Persistent histograms must be enabled as soon as possible. |
163 InstantiatePersistentHistograms(); | 162 InstantiatePersistentHistograms(); |
164 tracing::SetupBackgroundTracingFieldTrial(); | 163 tracing::SetupBackgroundTracingFieldTrial(); |
165 } | 164 } |
OLD | NEW |