summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
Diffstat (limited to 'net/base')
-rw-r--r--net/base/sdch_filter.cc20
-rw-r--r--net/base/sdch_manager.cc10
-rw-r--r--net/base/sdch_manager.h1
3 files changed, 17 insertions, 14 deletions
diff --git a/net/base/sdch_filter.cc b/net/base/sdch_filter.cc
index ce0acb8..2c747bc 100644
--- a/net/base/sdch_filter.cc
+++ b/net/base/sdch_filter.cc
@@ -40,7 +40,7 @@ SdchFilter::~SdchFilter() {
static int filter_use_count = 0;
++filter_use_count;
if (META_REFRESH_RECOVERY == decoding_status_) {
- UMA_HISTOGRAM_COUNTS("Sdch2.FilterUseBeforeDisabling", filter_use_count);
+ UMA_HISTOGRAM_COUNTS("Sdch3.FilterUseBeforeDisabling", filter_use_count);
}
if (vcdiff_streaming_decoder_.get()) {
@@ -51,22 +51,22 @@ SdchFilter::~SdchFilter() {
// Note this will "wear off" quickly enough, and is just meant to assure
// in some rare case that the user is not stuck.
SdchManager::BlacklistDomain(url_);
- UMA_HISTOGRAM_COUNTS("Sdch2.PartialBytesIn",
+ UMA_HISTOGRAM_COUNTS("Sdch3.PartialBytesIn",
static_cast<int>(filter_context().GetByteReadCount()));
- UMA_HISTOGRAM_COUNTS("Sdch2.PartialVcdiffIn", source_bytes_);
- UMA_HISTOGRAM_COUNTS("Sdch2.PartialVcdiffOut", output_bytes_);
+ UMA_HISTOGRAM_COUNTS("Sdch3.PartialVcdiffIn", source_bytes_);
+ UMA_HISTOGRAM_COUNTS("Sdch3.PartialVcdiffOut", output_bytes_);
}
}
if (!dest_buffer_excess_.empty()) {
// Filter chaining error, or premature teardown.
SdchManager::SdchErrorRecovery(SdchManager::UNFLUSHED_CONTENT);
- UMA_HISTOGRAM_COUNTS("Sdch2.UnflushedBytesIn",
+ UMA_HISTOGRAM_COUNTS("Sdch3.UnflushedBytesIn",
static_cast<int>(filter_context().GetByteReadCount()));
- UMA_HISTOGRAM_COUNTS("Sdch2.UnflushedBufferSize",
+ UMA_HISTOGRAM_COUNTS("Sdch3.UnflushedBufferSize",
dest_buffer_excess_.size());
- UMA_HISTOGRAM_COUNTS("Sdch2.UnflushedVcdiffIn", source_bytes_);
- UMA_HISTOGRAM_COUNTS("Sdch2.UnflushedVcdiffOut", output_bytes_);
+ UMA_HISTOGRAM_COUNTS("Sdch3.UnflushedVcdiffIn", source_bytes_);
+ UMA_HISTOGRAM_COUNTS("Sdch3.UnflushedVcdiffOut", output_bytes_);
}
if (was_cached_) {
@@ -79,10 +79,10 @@ SdchFilter::~SdchFilter() {
switch (decoding_status_) {
case DECODING_IN_PROGRESS: {
if (output_bytes_)
- UMA_HISTOGRAM_PERCENTAGE("Sdch2.Network_Decode_Ratio_a",
+ UMA_HISTOGRAM_PERCENTAGE("Sdch3.Network_Decode_Ratio_a",
static_cast<int>(
(filter_context().GetByteReadCount() * 100) / output_bytes_));
- UMA_HISTOGRAM_COUNTS("Sdch2.Network_Decode_Bytes_VcdiffOut_a",
+ UMA_HISTOGRAM_COUNTS("Sdch3.Network_Decode_Bytes_VcdiffOut_a",
output_bytes_);
filter_context().RecordPacketStats(FilterContext::SDCH_DECODE);
diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc
index 05b6475..7de9f0b 100644
--- a/net/base/sdch_manager.cc
+++ b/net/base/sdch_manager.cc
@@ -32,7 +32,7 @@ SdchManager* SdchManager::Global() {
// static
void SdchManager::SdchErrorRecovery(ProblemCodes problem) {
- static LinearHistogram histogram("Sdch2.ProblemCodes_3", MIN_PROBLEM_CODE,
+ static LinearHistogram histogram("Sdch3.ProblemCodes_3", MIN_PROBLEM_CODE,
MAX_PROBLEM_CODE - 1, MAX_PROBLEM_CODE);
histogram.SetFlags(kUmaTargetedHistogramFlag);
histogram.Add(problem);
@@ -272,7 +272,7 @@ bool SdchManager::AddSdchDictionary(const std::string& dictionary_text,
return false;
}
- UMA_HISTOGRAM_COUNTS("Sdch2.Dictionary size loaded", dictionary_text.size());
+ UMA_HISTOGRAM_COUNTS("Sdch3.Dictionary size loaded", dictionary_text.size());
DLOG(INFO) << "Loaded dictionary with client hash " << client_hash <<
" and server hash " << server_hash;
Dictionary* dictionary =
@@ -313,7 +313,7 @@ void SdchManager::GetAvailDictionaryList(const GURL& target_url,
}
// Watch to see if we have corrupt or numerous dictionaries.
if (count > 0)
- UMA_HISTOGRAM_COUNTS("Sdch2.Advertisement_Count", count);
+ UMA_HISTOGRAM_COUNTS("Sdch3.Advertisement_Count", count);
}
SdchManager::Dictionary::Dictionary(const std::string& dictionary_text,
@@ -413,8 +413,10 @@ bool SdchManager::Dictionary::CanSet(const std::string& domain,
// It is a postfix... so check to see if there's a dot in the prefix.
size_t end_of_host_index = referrer_url_host.find_first_of('.');
if (referrer_url_host.npos != end_of_host_index &&
- end_of_host_index < postfix_domain_index)
+ end_of_host_index < postfix_domain_index) {
+ SdchErrorRecovery(DICTIONARY_REFERER_URL_HAS_DOT_IN_PREFIX);
return false;
+ }
}
if (!ports.empty()
diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h
index 43fa484..679d771 100644
--- a/net/base/sdch_manager.h
+++ b/net/base/sdch_manager.h
@@ -90,6 +90,7 @@ class SdchManager {
DICTIONARY_DOMAIN_NOT_MATCHING_SOURCE_URL = 24,
DICTIONARY_PORT_NOT_MATCHING_SOURCE_URL = 25,
DICTIONARY_HAS_NO_TEXT = 26,
+ DICTIONARY_REFERER_URL_HAS_DOT_IN_PREFIX = 27,
// Dictionary loading problems.
DICTIONARY_LOAD_ATTEMPT_FROM_DIFFERENT_HOST = 30,