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

Side by Side Diff: chrome/browser/safe_browsing/srt_fetcher_win.cc

Issue 2388223002: SRTFetcher memory histograms should not use LinearHistogram. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/safe_browsing/srt_fetcher_win.h" 5 #include "chrome/browser/safe_browsing/srt_fetcher_win.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 // See UMA_HISTOGRAM_LONG_TIMES for the parameters to |FactoryTimeGet|. 461 // See UMA_HISTOGRAM_LONG_TIMES for the parameters to |FactoryTimeGet|.
462 auto histogram = base::Histogram::FactoryTimeGet( 462 auto histogram = base::Histogram::FactoryTimeGet(
463 FullName(name), base::TimeDelta::FromMilliseconds(1), 463 FullName(name), base::TimeDelta::FromMilliseconds(1),
464 base::TimeDelta::FromHours(1), 100, kUmaHistogramFlag); 464 base::TimeDelta::FromHours(1), 100, kUmaHistogramFlag);
465 if (histogram) 465 if (histogram)
466 histogram->AddTime(sample); 466 histogram->AddTime(sample);
467 } 467 }
468 468
469 void RecordMemoryKBHistogram(const std::string& name, Sample sample) const { 469 void RecordMemoryKBHistogram(const std::string& name, Sample sample) const {
470 // See UMA_HISTOGRAM_MEMORY_KB for the parameters to |FactoryGet|. 470 // See UMA_HISTOGRAM_MEMORY_KB for the parameters to |FactoryGet|.
471 auto histogram = base::LinearHistogram::FactoryGet( 471 auto histogram = base::Histogram::FactoryGet(FullName(name), 1000, 500000,
472 FullName(name), 1000, 500000, 50, kUmaHistogramFlag); 472 50, kUmaHistogramFlag);
473 if (histogram) 473 if (histogram)
474 histogram->Add(sample); 474 histogram->Add(sample);
475 } 475 }
476 476
477 void RecordSparseHistogram(const std::string& name, Sample sample) const { 477 void RecordSparseHistogram(const std::string& name, Sample sample) const {
478 auto histogram = 478 auto histogram =
479 base::SparseHistogram::FactoryGet(FullName(name), kUmaHistogramFlag); 479 base::SparseHistogram::FactoryGet(FullName(name), kUmaHistogramFlag);
480 if (histogram) 480 if (histogram)
481 histogram->Add(sample); 481 histogram->Add(sample);
482 } 482 }
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(), 1065 return srt_cleaner_key.Open(HKEY_CURRENT_USER, cleaner_key_path.c_str(),
1066 KEY_QUERY_VALUE) == ERROR_SUCCESS && 1066 KEY_QUERY_VALUE) == ERROR_SUCCESS &&
1067 srt_cleaner_key.GetValueCount() > 0; 1067 srt_cleaner_key.GetValueCount() > 0;
1068 } 1068 }
1069 1069
1070 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) { 1070 void SetSwReporterTestingDelegate(SwReporterTestingDelegate* delegate) {
1071 g_testing_delegate_ = delegate; 1071 g_testing_delegate_ = delegate;
1072 } 1072 }
1073 1073
1074 } // namespace safe_browsing 1074 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698