Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: components/rappor/rappor_service.cc

Issue 872813003: Add Rappor metrics for Safe Browsing and SSL interstitials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fit nit: Remove _MAX from enum Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | tools/metrics/rappor/rappor.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | tools/metrics/rappor/rappor.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698