OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/rappor/rappor_service.h" | 5 #include "components/rappor/rappor_service.h" |
6 | 6 |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "components/metrics/metrics_hashes.h" | 10 #include "components/metrics/metrics_hashes.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 << recording_level; | 119 << recording_level; |
120 recording_level_ = recording_level; | 120 recording_level_ = recording_level; |
121 ScheduleNextLogRotation( | 121 ScheduleNextLogRotation( |
122 base::TimeDelta::FromSeconds(kInitialLogIntervalSeconds)); | 122 base::TimeDelta::FromSeconds(kInitialLogIntervalSeconds)); |
123 } else { | 123 } else { |
124 DVLOG(1) << "RapporService recording_level changed:" << recording_level; | 124 DVLOG(1) << "RapporService recording_level changed:" << recording_level; |
125 recording_level_ = recording_level; | 125 recording_level_ = recording_level; |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 DVLOG(1) << "RapporService may_upload=" << may_upload; | 129 DVLOG(1) << "RapporService recording_level=" << recording_level_ |
| 130 << " may_upload=" << may_upload; |
130 if (may_upload) { | 131 if (may_upload) { |
131 uploader_->Start(); | 132 uploader_->Start(); |
132 } else { | 133 } else { |
133 uploader_->Stop(); | 134 uploader_->Stop(); |
134 } | 135 } |
135 } | 136 } |
136 | 137 |
137 // static | 138 // static |
138 void RapporService::RegisterPrefs(PrefRegistrySimple* registry) { | 139 void RapporService::RegisterPrefs(PrefRegistrySimple* registry) { |
139 internal::RegisterPrefs(registry); | 140 internal::RegisterPrefs(registry); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 DCHECK_EQ(parameters.ToString(), metric->parameters().ToString()); | 253 DCHECK_EQ(parameters.ToString(), metric->parameters().ToString()); |
253 return metric; | 254 return metric; |
254 } | 255 } |
255 | 256 |
256 RapporMetric* new_metric = new RapporMetric(metric_name, parameters, cohort_); | 257 RapporMetric* new_metric = new RapporMetric(metric_name, parameters, cohort_); |
257 metrics_map_[metric_name] = new_metric; | 258 metrics_map_[metric_name] = new_metric; |
258 return new_metric; | 259 return new_metric; |
259 } | 260 } |
260 | 261 |
261 } // namespace rappor | 262 } // namespace rappor |
OLD | NEW |