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

Side by Side Diff: net/base/sdch_manager.cc

Issue 515033: Cleanup histogram classes mixing SetFlags into FactoryGet arguments... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 12 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 | Annotate | Revision Log
« no previous file with comments | « net/base/mime_sniffer.cc ('k') | net/disk_cache/histogram_macros.h » ('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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/base64.h" 5 #include "base/base64.h"
6 #include "base/field_trial.h" 6 #include "base/field_trial.h"
7 #include "base/histogram.h" 7 #include "base/histogram.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/sha2.h" 9 #include "base/sha2.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 14 matching lines...) Expand all
25 // static 25 // static
26 SdchManager* SdchManager::global_; 26 SdchManager* SdchManager::global_;
27 27
28 // static 28 // static
29 SdchManager* SdchManager::Global() { 29 SdchManager* SdchManager::Global() {
30 return global_; 30 return global_;
31 } 31 }
32 32
33 // static 33 // static
34 void SdchManager::SdchErrorRecovery(ProblemCodes problem) { 34 void SdchManager::SdchErrorRecovery(ProblemCodes problem) {
35 static scoped_refptr<Histogram> histogram = 35 UMA_HISTOGRAM_ENUMERATION("Sdch3.ProblemCodes_4", problem, MAX_PROBLEM_CODE);
36 LinearHistogram::LinearHistogramFactoryGet("Sdch3.ProblemCodes_4",
37 MIN_PROBLEM_CODE + 1, MAX_PROBLEM_CODE - 1, MAX_PROBLEM_CODE);
38 histogram->SetFlags(kUmaTargetedHistogramFlag);
39 histogram->Add(problem);
40 } 36 }
41 37
42 // static 38 // static
43 void SdchManager::ClearBlacklistings() { 39 void SdchManager::ClearBlacklistings() {
44 Global()->blacklisted_domains_.clear(); 40 Global()->blacklisted_domains_.clear();
45 Global()->exponential_blacklist_count.clear(); 41 Global()->exponential_blacklist_count.clear();
46 } 42 }
47 43
48 // static 44 // static
49 void SdchManager::ClearDomainBlacklisting(const std::string& domain) { 45 void SdchManager::ClearDomainBlacklisting(const std::string& domain) {
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 if (enable) { 528 if (enable) {
533 allow_latency_experiment_.insert(url.host()); 529 allow_latency_experiment_.insert(url.host());
534 return; 530 return;
535 } 531 }
536 ExperimentSet::iterator it = allow_latency_experiment_.find(url.host()); 532 ExperimentSet::iterator it = allow_latency_experiment_.find(url.host());
537 if (allow_latency_experiment_.end() == it) 533 if (allow_latency_experiment_.end() == it)
538 return; // It was already erased, or never allowed. 534 return; // It was already erased, or never allowed.
539 SdchErrorRecovery(LATENCY_TEST_DISALLOWED); 535 SdchErrorRecovery(LATENCY_TEST_DISALLOWED);
540 allow_latency_experiment_.erase(it); 536 allow_latency_experiment_.erase(it);
541 } 537 }
OLDNEW
« no previous file with comments | « net/base/mime_sniffer.cc ('k') | net/disk_cache/histogram_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698