Commit fdc4699f authored by clamy@chromium.org's avatar clamy@chromium.org

Remove special case in HTTP header flattening in WebURLLoaderImpl

Following https://chromiumcodereview.appspot.com/318673002/ blink will no
longer be setting cache headers, so the special case that skips over cache
headers is not needed anymore.

BUG=376025

Review URL: https://codereview.chromium.org/316883002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275466 0039d316-1c4b-4281-b951-d872f2087c98
parent e52c957b
...@@ -73,10 +73,7 @@ const char kThrottledErrorDescription[] = ...@@ -73,10 +73,7 @@ const char kThrottledErrorDescription[] =
class HeaderFlattener : public WebHTTPHeaderVisitor { class HeaderFlattener : public WebHTTPHeaderVisitor {
public: public:
explicit HeaderFlattener(int load_flags) explicit HeaderFlattener() : has_accept_header_(false) {}
: load_flags_(load_flags),
has_accept_header_(false) {
}
virtual void visitHeader(const WebString& name, const WebString& value) { virtual void visitHeader(const WebString& name, const WebString& value) {
// Headers are latin1. // Headers are latin1.
...@@ -88,16 +85,6 @@ class HeaderFlattener : public WebHTTPHeaderVisitor { ...@@ -88,16 +85,6 @@ class HeaderFlattener : public WebHTTPHeaderVisitor {
if (LowerCaseEqualsASCII(name_latin1, "referer")) if (LowerCaseEqualsASCII(name_latin1, "referer"))
return; 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")) if (LowerCaseEqualsASCII(name_latin1, "accept"))
has_accept_header_ = true; has_accept_header_ = true;
...@@ -119,7 +106,6 @@ class HeaderFlattener : public WebHTTPHeaderVisitor { ...@@ -119,7 +106,6 @@ class HeaderFlattener : public WebHTTPHeaderVisitor {
} }
private: private:
int load_flags_;
std::string buffer_; std::string buffer_;
bool has_accept_header_; bool has_accept_header_;
}; };
...@@ -377,7 +363,7 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request, ...@@ -377,7 +363,7 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN; load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN;
} }
HeaderFlattener flattener(load_flags); HeaderFlattener flattener;
request.visitHTTPHeaderFields(&flattener); request.visitHTTPHeaderFields(&flattener);
// TODO(brettw) this should take parameter encoding into account when // TODO(brettw) this should take parameter encoding into account when
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment