Index: net/filter/filter.cc |
diff --git a/net/filter/filter.cc b/net/filter/filter.cc |
index d77272a809d99412ad471cc97095adf4abb43f23..c7a972ee78c993b7233231999fe4371733b4de02 100644 |
--- a/net/filter/filter.cc |
+++ b/net/filter/filter.cc |
@@ -161,6 +161,9 @@ void Filter::FixupEncodingTypes( |
bool success = filter_context.GetMimeType(&mime_type); |
DCHECK(success || mime_type.empty()); |
+ GURL url; |
+ success = filter_context.GetURL(&url); |
+ |
if ((1 == encoding_types->size()) && |
(FILTER_TYPE_GZIP == encoding_types->front())) { |
if (LowerCaseEqualsASCII(mime_type, kApplicationXGzip) || |
@@ -172,10 +175,8 @@ void Filter::FixupEncodingTypes( |
// the Content-Encoding here. |
encoding_types->clear(); |
- GURL url; |
- std::string disposition; |
- success = filter_context.GetURL(&url); |
DCHECK(success); |
+ std::string disposition; |
filter_context.GetContentDisposition(&disposition); |
// Don't supply a MIME type here, since that may cause disk IO. |
base::FilePath::StringType extension = |
@@ -210,13 +211,13 @@ void Filter::FixupEncodingTypes( |
// It was not an SDCH request, so we'll just record stats. |
if (1 < encoding_types->size()) { |
// Multiple filters were intended to only be used for SDCH (thus far!) |
- SdchManager::SdchErrorRecovery( |
+ filter_context.LogSdchProblem( |
SdchManager::MULTIENCODING_FOR_NON_SDCH_REQUEST); |
} |
if ((1 == encoding_types->size()) && |
(FILTER_TYPE_SDCH == encoding_types->front())) { |
- SdchManager::SdchErrorRecovery( |
- SdchManager::SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST); |
+ filter_context.LogSdchProblem( |
+ SdchManager::SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST); |
} |
return; |
} |
@@ -236,7 +237,7 @@ void Filter::FixupEncodingTypes( |
// no-op pass through filter if it doesn't get gzip headers where expected. |
if (1 == encoding_types->size()) { |
encoding_types->push_back(FILTER_TYPE_GZIP_HELPING_SDCH); |
- SdchManager::SdchErrorRecovery( |
+ filter_context.LogSdchProblem( |
SdchManager::OPTIONAL_GUNZIP_ENCODING_ADDED); |
} |
return; |
@@ -271,14 +272,11 @@ void Filter::FixupEncodingTypes( |
// Suspicious case: Advertised dictionary, but server didn't use sdch, and |
// we're HTML tagged. |
if (encoding_types->empty()) { |
- SdchManager::SdchErrorRecovery( |
- SdchManager::ADDED_CONTENT_ENCODING); |
+ filter_context.LogSdchProblem(SdchManager::ADDED_CONTENT_ENCODING); |
} else if (1 == encoding_types->size()) { |
- SdchManager::SdchErrorRecovery( |
- SdchManager::FIXED_CONTENT_ENCODING); |
+ filter_context.LogSdchProblem(SdchManager::FIXED_CONTENT_ENCODING); |
} else { |
- SdchManager::SdchErrorRecovery( |
- SdchManager::FIXED_CONTENT_ENCODINGS); |
+ filter_context.LogSdchProblem(SdchManager::FIXED_CONTENT_ENCODINGS); |
} |
} else { |
// Remarkable case!?! We advertised an SDCH dictionary, content-encoding |
@@ -290,13 +288,11 @@ void Filter::FixupEncodingTypes( |
// start with "text/html" for some other reason?? We'll report this as a |
// fixup to a binary file, but it probably really is text/html (some how). |
if (encoding_types->empty()) { |
- SdchManager::SdchErrorRecovery( |
- SdchManager::BINARY_ADDED_CONTENT_ENCODING); |
+ filter_context.LogSdchProblem(SdchManager::BINARY_ADDED_CONTENT_ENCODING); |
} else if (1 == encoding_types->size()) { |
- SdchManager::SdchErrorRecovery( |
- SdchManager::BINARY_FIXED_CONTENT_ENCODING); |
+ filter_context.LogSdchProblem(SdchManager::BINARY_FIXED_CONTENT_ENCODING); |
} else { |
- SdchManager::SdchErrorRecovery( |
+ filter_context.LogSdchProblem( |
SdchManager::BINARY_FIXED_CONTENT_ENCODINGS); |
} |
} |