summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-27 23:51:33 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-27 23:51:33 +0000
commitf081bbf106d0e49697a4b2dd354d356488072e9e (patch)
tree4a93e3ef8260303c5be13b62e9c1ee20d8d812ab /net
parent69aef0f1e91c942f3fc34cfb41e87a5dd247b317 (diff)
downloadchromium_src-f081bbf106d0e49697a4b2dd354d356488072e9e.zip
chromium_src-f081bbf106d0e49697a4b2dd354d356488072e9e.tar.gz
chromium_src-f081bbf106d0e49697a4b2dd354d356488072e9e.tar.bz2
Distinguish a few more SDCH cases via problem codes
r=huanr Review URL: http://codereview.chromium.org/27284 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10649 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/filter_unittest.cc4
-rw-r--r--net/base/sdch_filter.cc18
-rw-r--r--net/base/sdch_manager.h8
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.
};