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

Unified Diff: content/child/web_url_loader_impl.cc

Issue 316883002: Remove special case in HTTP header flattening in WebURLLoaderImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the compilation issue for real Created 6 years, 6 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_url_loader_impl.cc
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index 35646d2402ed4ce801161a6e3a2a755c545a9e82..803f5e50eb647e42fb1277e4b5ab8fde8f097e07 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -73,10 +73,7 @@ const char kThrottledErrorDescription[] =
class HeaderFlattener : public WebHTTPHeaderVisitor {
public:
- explicit HeaderFlattener(int load_flags)
- : load_flags_(load_flags),
- has_accept_header_(false) {
- }
+ explicit HeaderFlattener() : has_accept_header_(false) {}
virtual void visitHeader(const WebString& name, const WebString& value) {
// Headers are latin1.
@@ -88,16 +85,6 @@ class HeaderFlattener : public WebHTTPHeaderVisitor {
if (LowerCaseEqualsASCII(name_latin1, "referer"))
return;
- // Skip over "Cache-Control: max-age=0" header if the corresponding
- // load flag is already specified. FrameLoader sets both the flag and
- // the extra header -- the extra header is redundant since our network
- // implementation will add the necessary headers based on load flags.
- // See http://code.google.com/p/chromium/issues/detail?id=3434.
- if ((load_flags_ & net::LOAD_VALIDATE_CACHE) &&
- LowerCaseEqualsASCII(name_latin1, "cache-control") &&
- LowerCaseEqualsASCII(value_latin1, "max-age=0"))
- return;
-
if (LowerCaseEqualsASCII(name_latin1, "accept"))
has_accept_header_ = true;
@@ -119,7 +106,6 @@ class HeaderFlattener : public WebHTTPHeaderVisitor {
}
private:
- int load_flags_;
std::string buffer_;
bool has_accept_header_;
};
@@ -377,7 +363,7 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN;
}
- HeaderFlattener flattener(load_flags);
+ HeaderFlattener flattener;
request.visitHTTPHeaderFields(&flattener);
// TODO(brettw) this should take parameter encoding into account when
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698