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

Unified Diff: net/base/sdch_manager.cc

Issue 8018: Clean up filter and content encoding handling ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/sdch_manager.h ('k') | net/build/net_unittests.vcproj » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/sdch_manager.cc
===================================================================
--- net/base/sdch_manager.cc (revision 4002)
+++ net/base/sdch_manager.cc (working copy)
@@ -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 @@
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 @@
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 @@
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 @@
*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;
« no previous file with comments | « net/base/sdch_manager.h ('k') | net/build/net_unittests.vcproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698