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

Unified Diff: net/base/sdch_filter.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/gzip_filter_unittest.cc ('k') | net/base/sdch_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/sdch_filter.cc
===================================================================
--- net/base/sdch_filter.cc (revision 4002)
+++ net/base/sdch_filter.cc (working copy)
@@ -29,7 +29,7 @@
static int filter_use_count = 0;
++filter_use_count;
if (META_REFRESH_RECOVERY == decoding_status_) {
- HISTOGRAM_COUNTS(L"Sdch.FilterUseBeforeDisabling", filter_use_count);
+ UMA_HISTOGRAM_COUNTS(L"Sdch.FilterUseBeforeDisabling", filter_use_count);
}
if (vcdiff_streaming_decoder_.get()) {
@@ -37,9 +37,8 @@
decoding_status_ = DECODING_ERROR;
}
- // TODO(jar): Use UMA_HISTOGRAM when we turn sdch on by default.
- HISTOGRAM_COUNTS(L"Sdch.Bytes read", source_bytes_);
- HISTOGRAM_COUNTS(L"Sdch.Bytes output", output_bytes_);
+ UMA_HISTOGRAM_COUNTS(L"Sdch.Bytes read", source_bytes_);
+ UMA_HISTOGRAM_COUNTS(L"Sdch.Bytes output", output_bytes_);
if (dictionary_)
dictionary_->Release();
@@ -82,6 +81,8 @@
DCHECK(0 == dest_buffer_excess_index_);
DCHECK(dest_buffer_excess_.empty());
if (!dictionary_hash_is_plausible_) {
+ // One of the first 9 bytes precluded consideration as a hash.
+ // This can't be an SDCH payload.
SdchManager::SdchErrorRecovery(SdchManager::PASSING_THROUGH_NON_SDCH);
decoding_status_ = PASS_THROUGH;
dest_buffer_excess_ = dictionary_hash_; // Send what we scanned.
@@ -185,6 +186,7 @@
if (!dictionary_) {
DCHECK(dictionary_hash_.size() == kServerIdLength);
+ // Since dictionary was not found, check to see if hash was even plausible.
for (size_t i = 0; i < kServerIdLength - 1; ++i) {
char base64_char = dictionary_hash_[i];
if (!isalnum(base64_char) && '-' != base64_char && '_' != base64_char) {
« no previous file with comments | « net/base/gzip_filter_unittest.cc ('k') | net/base/sdch_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698