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

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

Issue 11810: Adjust histograms to get better data for latency experiments... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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
« net/base/sdch_manager.h ('K') | « net/base/sdch_manager.h ('k') | 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 (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/field_trial.h" 5 #include "base/field_trial.h"
6 #include "base/histogram.h" 6 #include "base/histogram.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/sha2.h" 8 #include "base/sha2.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/base64.h" 10 #include "net/base/base64.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 dictionaries_.erase(it->first); 58 dictionaries_.erase(it->first);
59 } 59 }
60 global_ = NULL; 60 global_ = NULL;
61 } 61 }
62 62
63 // static 63 // static
64 bool SdchManager::BlacklistDomain(const GURL& url) { 64 bool SdchManager::BlacklistDomain(const GURL& url) {
65 if (!global_ ) 65 if (!global_ )
66 return false; 66 return false;
67 std::string domain(url.host()); 67 std::string domain(url.host());
68 UMA_HISTOGRAM_TIMES(L"Sdch.UptimeBeforeBlacklisting", 68 UMA_HISTOGRAM_MEDIUM_TIMES(L"Sdch.UptimeBeforeBlacklisting_M",
69 Time::Now() - FieldTrialList::application_start_time()); 69 Time::Now() - FieldTrialList::application_start_time());
70 global_->blacklisted_domains_.insert(url.host()); 70 global_->blacklisted_domains_.insert(url.host());
71 return true; 71 return true;
72 } 72 }
73 73
74 void SdchManager::EnableSdchSupport(const std::string& domain) { 74 void SdchManager::EnableSdchSupport(const std::string& domain) {
75 // We presume that there is a SDCH manager instance. 75 // We presume that there is a SDCH manager instance.
76 global_->supported_domain_ = domain; 76 global_->supported_domain_ = domain;
77 global_->sdch_enabled_ = true; 77 global_->sdch_enabled_ = true;
78 } 78 }
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 return false; 447 return false;
448 return restriction[prefix_length - 1] == '/' || path[prefix_length] == '/'; 448 return restriction[prefix_length - 1] == '/' || path[prefix_length] == '/';
449 } 449 }
450 450
451 // static 451 // static
452 bool SdchManager::Dictionary::DomainMatch(const GURL& gurl, 452 bool SdchManager::Dictionary::DomainMatch(const GURL& gurl,
453 const std::string& restriction) { 453 const std::string& restriction) {
454 // TODO(jar): This is not precisely a domain match definition. 454 // TODO(jar): This is not precisely a domain match definition.
455 return gurl.DomainIs(restriction.data(), restriction.size()); 455 return gurl.DomainIs(restriction.data(), restriction.size());
456 } 456 }
OLDNEW
« net/base/sdch_manager.h ('K') | « net/base/sdch_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698