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

Unified Diff: net/filter/filter.cc

Issue 704493002: Revert "Sdch view for net-internals" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/filter/filter.h ('k') | net/filter/mock_filter_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/filter/filter.cc
diff --git a/net/filter/filter.cc b/net/filter/filter.cc
index c9a56bd9573dd3668494e0d31f4e05c52ed52439..c8a4740a40af3b01479bfba4e76860bc7fdf6e2d 100644
--- a/net/filter/filter.cc
+++ b/net/filter/filter.cc
@@ -28,14 +28,11 @@
#include "net/base/filename_util_unsafe.h"
#include "net/base/io_buffer.h"
#include "net/base/mime_util.h"
-#include "net/base/sdch_net_log_params.h"
#include "net/filter/gzip_filter.h"
#include "net/filter/sdch_filter.h"
#include "net/url_request/url_request_context.h"
#include "url/gurl.h"
-namespace net {
-
namespace {
// Filter types (using canonical lower case only):
@@ -56,16 +53,10 @@ const char kTextHtml[] = "text/html";
// Buffer size allocated when de-compressing data.
const int kFilterBufSize = 32 * 1024;
-void LogSdchProblem(const FilterContext& filter_context,
- SdchProblemCode problem) {
- SdchManager::SdchErrorRecovery(problem);
- filter_context.GetNetLog().AddEvent(
- NetLog::TYPE_SDCH_DECODING_ERROR,
- base::Bind(&NetLogSdchResourceProblemCallback, problem));
-}
-
} // namespace
+namespace net {
+
FilterContext::~FilterContext() {
}
@@ -242,12 +233,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!)
- LogSdchProblem(filter_context, SDCH_MULTIENCODING_FOR_NON_SDCH_REQUEST);
+ SdchManager::SdchErrorRecovery(
+ SdchManager::MULTIENCODING_FOR_NON_SDCH_REQUEST);
}
if ((1 == encoding_types->size()) &&
(FILTER_TYPE_SDCH == encoding_types->front())) {
- LogSdchProblem(filter_context,
- SDCH_SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST);
+ SdchManager::SdchErrorRecovery(
+ SdchManager::SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST);
}
return;
}
@@ -267,7 +259,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);
- LogSdchProblem(filter_context, SDCH_OPTIONAL_GUNZIP_ENCODING_ADDED);
+ SdchManager::SdchErrorRecovery(
+ SdchManager::OPTIONAL_GUNZIP_ENCODING_ADDED);
}
return;
}
@@ -301,11 +294,14 @@ void Filter::FixupEncodingTypes(
// Suspicious case: Advertised dictionary, but server didn't use sdch, and
// we're HTML tagged.
if (encoding_types->empty()) {
- LogSdchProblem(filter_context, SDCH_ADDED_CONTENT_ENCODING);
+ SdchManager::SdchErrorRecovery(
+ SdchManager::ADDED_CONTENT_ENCODING);
} else if (1 == encoding_types->size()) {
- LogSdchProblem(filter_context, SDCH_FIXED_CONTENT_ENCODING);
+ SdchManager::SdchErrorRecovery(
+ SdchManager::FIXED_CONTENT_ENCODING);
} else {
- LogSdchProblem(filter_context, SDCH_FIXED_CONTENT_ENCODINGS);
+ SdchManager::SdchErrorRecovery(
+ SdchManager::FIXED_CONTENT_ENCODINGS);
}
} else {
// Remarkable case!?! We advertised an SDCH dictionary, content-encoding
@@ -317,11 +313,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()) {
- LogSdchProblem(filter_context, SDCH_BINARY_ADDED_CONTENT_ENCODING);
+ SdchManager::SdchErrorRecovery(
+ SdchManager::BINARY_ADDED_CONTENT_ENCODING);
} else if (1 == encoding_types->size()) {
- LogSdchProblem(filter_context, SDCH_BINARY_FIXED_CONTENT_ENCODING);
+ SdchManager::SdchErrorRecovery(
+ SdchManager::BINARY_FIXED_CONTENT_ENCODING);
} else {
- LogSdchProblem(filter_context, SDCH_BINARY_FIXED_CONTENT_ENCODINGS);
+ SdchManager::SdchErrorRecovery(
+ SdchManager::BINARY_FIXED_CONTENT_ENCODINGS);
}
}
« no previous file with comments | « net/filter/filter.h ('k') | net/filter/mock_filter_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698