diff options
author | jar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 17:39:28 +0000 |
---|---|---|
committer | jar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 17:39:28 +0000 |
commit | 423041b0a7182411149472ae1e7fd87317173097 (patch) | |
tree | 494092141aa32f87e6bf02159579ae590d0a3fbf /net/base/sdch_manager.cc | |
parent | c05ef7e4fe5aaadb4193217209a11440bd4d2c27 (diff) | |
download | chromium_src-423041b0a7182411149472ae1e7fd87317173097.zip chromium_src-423041b0a7182411149472ae1e7fd87317173097.tar.gz chromium_src-423041b0a7182411149472ae1e7fd87317173097.tar.bz2 |
Clean up filter and content encoding handling
Centralize translation functions (text of "Content-Encoding" to enum)
in filter.cc
Centralize error recovery (for damaged content encoding headers) in filter.cc
Error recovery includes a loss of SDCH encoding headers, plus handling
of Apache server bug with gzip files are tagged as also being gzip encoded.
Centralize and add a pile of unit tests to this filter code.
r=openvcdiff,huanr
Review URL: http://codereview.chromium.org/8018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4004 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/sdch_manager.cc')
-rw-r--r-- | net/base/sdch_manager.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc index 5b86a650..365c8de 100644 --- a/net/base/sdch_manager.cc +++ b/net/base/sdch_manager.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/field_trial.h" #include "base/histogram.h" #include "base/logging.h" #include "base/sha2.h" @@ -25,7 +26,7 @@ SdchManager* SdchManager::Global() { void SdchManager::SdchErrorRecovery(ProblemCodes problem) { static LinearHistogram histogram(L"Sdch.ProblemCodes", MIN_PROBLEM_CODE, MAX_PROBLEM_CODE - 1, MAX_PROBLEM_CODE); - // TODO(jar): Set UMA flag for uploading. + histogram.SetFlags(kUmaTargetedHistogramFlag); histogram.Add(problem); } @@ -51,11 +52,13 @@ SdchManager::~SdchManager() { global_ = NULL; } -// static +// static bool SdchManager::BlacklistDomain(const GURL& url) { if (!global_ ) return false; std::string domain(url.host()); + UMA_HISTOGRAM_TIMES(L"Sdch.UptimeBeforeBlacklisting", + Time::Now() - FieldTrialList::application_start_time()); global_->blacklisted_domains_.insert(url.host()); return true; } @@ -171,7 +174,7 @@ bool SdchManager::AddSdchDictionary(const std::string& dictionary_text, if (!Dictionary::CanSet(domain, path, ports, dictionary_url)) return false; - HISTOGRAM_COUNTS(L"Sdch.Dictionary size loaded", dictionary_text.size()); + UMA_HISTOGRAM_COUNTS(L"Sdch.Dictionary size loaded", dictionary_text.size()); DLOG(INFO) << "Loaded dictionary with client hash " << client_hash << " and server hash " << server_hash; Dictionary* dictionary = @@ -187,7 +190,6 @@ void SdchManager::GetVcdiffDictionary(const std::string& server_hash, *dictionary = NULL; DictionaryMap::iterator it = dictionaries_.find(server_hash); if (it == dictionaries_.end()) { - SdchErrorRecovery(DICTIONARY_NOT_FOUND_FOR_HASH); return; } Dictionary* matching_dictionary = it->second; |