| Index: net/filter/filter.cc
|
| diff --git a/net/filter/filter.cc b/net/filter/filter.cc
|
| index d77272a809d99412ad471cc97095adf4abb43f23..3aea4cfa3ece0d2f6d2f18212e35b0aa8fff779e 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 =
|
| @@ -205,18 +206,21 @@ void Filter::FixupEncodingTypes(
|
| }
|
| }
|
|
|
| + SdchManager* sdch_manager =
|
| + filter_context.GetURLRequestContext()->sdch_manager();
|
| +
|
| // If the request was for SDCH content, then we might need additional fixups.
|
| if (!filter_context.IsSdchResponse()) {
|
| // 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(
|
| - SdchManager::MULTIENCODING_FOR_NON_SDCH_REQUEST);
|
| + sdch_manager->SdchErrorRecovery(
|
| + SdchManager::MULTIENCODING_FOR_NON_SDCH_REQUEST, url);
|
| }
|
| if ((1 == encoding_types->size()) &&
|
| (FILTER_TYPE_SDCH == encoding_types->front())) {
|
| - SdchManager::SdchErrorRecovery(
|
| - SdchManager::SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST);
|
| + sdch_manager->SdchErrorRecovery(
|
| + SdchManager::SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST, url);
|
| }
|
| return;
|
| }
|
| @@ -236,8 +240,8 @@ 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(
|
| - SdchManager::OPTIONAL_GUNZIP_ENCODING_ADDED);
|
| + sdch_manager->SdchErrorRecovery(
|
| + SdchManager::OPTIONAL_GUNZIP_ENCODING_ADDED, url);
|
| }
|
| return;
|
| }
|
| @@ -271,14 +275,14 @@ 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);
|
| + sdch_manager->SdchErrorRecovery(
|
| + SdchManager::ADDED_CONTENT_ENCODING, url);
|
| } else if (1 == encoding_types->size()) {
|
| - SdchManager::SdchErrorRecovery(
|
| - SdchManager::FIXED_CONTENT_ENCODING);
|
| + sdch_manager->SdchErrorRecovery(
|
| + SdchManager::FIXED_CONTENT_ENCODING, url);
|
| } else {
|
| - SdchManager::SdchErrorRecovery(
|
| - SdchManager::FIXED_CONTENT_ENCODINGS);
|
| + sdch_manager->SdchErrorRecovery(
|
| + SdchManager::FIXED_CONTENT_ENCODINGS, url);
|
| }
|
| } else {
|
| // Remarkable case!?! We advertised an SDCH dictionary, content-encoding
|
| @@ -290,14 +294,14 @@ 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);
|
| + sdch_manager->SdchErrorRecovery(
|
| + SdchManager::BINARY_ADDED_CONTENT_ENCODING, url);
|
| } else if (1 == encoding_types->size()) {
|
| - SdchManager::SdchErrorRecovery(
|
| - SdchManager::BINARY_FIXED_CONTENT_ENCODING);
|
| + sdch_manager->SdchErrorRecovery(
|
| + SdchManager::BINARY_FIXED_CONTENT_ENCODING, url);
|
| } else {
|
| - SdchManager::SdchErrorRecovery(
|
| - SdchManager::BINARY_FIXED_CONTENT_ENCODINGS);
|
| + sdch_manager->SdchErrorRecovery(
|
| + SdchManager::BINARY_FIXED_CONTENT_ENCODINGS, url);
|
| }
|
| }
|
|
|
|
|