diff options
-rw-r--r-- | net/base/filter_unittest.cc | 4 | ||||
-rw-r--r-- | net/base/sdch_filter.cc | 18 | ||||
-rw-r--r-- | net/base/sdch_manager.h | 8 |
3 files changed, 25 insertions, 5 deletions
diff --git a/net/base/filter_unittest.cc b/net/base/filter_unittest.cc index c9e7308..1d6ae6e 100644 --- a/net/base/filter_unittest.cc +++ b/net/base/filter_unittest.cc @@ -129,8 +129,8 @@ TEST(FilterTest, MissingSdchEncoding) { // Loss of encoding, but it was an SDCH response with a prefix that says it // was an html type. Note that it *should* be the case that a precise match // with "text/html" we be collected by GetMimeType() and passed in, but we - // coded the fixup defensively (scanning for a prexif of "text/html", so this - // is an example which could survive such confusion in the caller. + // coded the fixup defensively (scanning for a prefix of "text/html", so this + // is an example which could survive such confusion in the caller). encoding_types.clear(); Filter::FixupEncodingTypes(is_sdch_response, "text/html; charset=UTF-8", &encoding_types); diff --git a/net/base/sdch_filter.cc b/net/base/sdch_filter.cc index b0f19a6..2d44421 100644 --- a/net/base/sdch_filter.cc +++ b/net/base/sdch_filter.cc @@ -45,9 +45,21 @@ SdchFilter::~SdchFilter() { } } - if (!was_cached() - && base::Time() != connect_time() - && read_times_.size() > 0) { + if (!dest_buffer_excess_.empty()) { + // Filter chaining error, or premature teardown. + SdchManager::SdchErrorRecovery(SdchManager::UNFLUSHED_CONTENT); + } + + if (was_cached()) { + // Not a real error, but it is useful to have this tally. + // TODO(jar): Remove this stat after SDCH stability is validated. + SdchManager::SdchErrorRecovery(SdchManager::CACHE_DECODED); + } else if (base::Time() == connect_time() + || read_times_.empty()) { + // Not a real error, but it is useful to have this tally. + // TODO(jar): Remove this stat after SDCH stability is validated. + SdchManager::SdchErrorRecovery(SdchManager::MISSING_TIME_STATS); + } else { base::TimeDelta duration = read_times_.back() - connect_time(); // We clip our logging at 10 minutes to prevent anamolous data from being // considered (per suggestion from Jake Brutlag). diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h index f622236..e6ad7a0 100644 --- a/net/base/sdch_manager.h +++ b/net/base/sdch_manager.h @@ -126,6 +126,14 @@ class SdchManager { META_REFRESH_CACHED_RECOVERY = 80, // Probably startup tab loading. DISCARD_TENTATIVE_SDCH = 81, // Server decided not to use sdch. + // Non SDCH problems, only accounted for to make stat counting complete + // (i.e., be able to be sure all dictionary advertisements are accounted + // for). + + UNFLUSHED_CONTENT = 90, // Possible error in filter chaining. + MISSING_TIME_STATS = 91, // Should never happen. + CACHE_DECODED = 92, // Hence there are no timing stats recorded. + MAX_PROBLEM_CODE // Used to bound histogram. }; |