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

Unified Diff: net/http/http_response_headers.cc

Issue 10387200: Suppress pause-and-buffer behavior when the HTTP response won't satisfy future requests via cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Alternative implementation requiring no further WebKit changes Created 8 years, 7 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 | net/http/http_util.h » ('j') | webkit/media/buffered_resource_loader.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_headers.cc
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
index 33d78dad0dee6ed21f634baa6fdc2b32ba9d4825..ea7019d2bd115e0bd2de25bc185d0425e9afb42b 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -1160,32 +1160,14 @@ bool HttpResponseHeaders::IsKeepAlive() const {
}
bool HttpResponseHeaders::HasStrongValidators() const {
- if (GetHttpVersion() < HttpVersion(1, 1))
- return false;
-
- std::string etag_value;
- EnumerateHeader(NULL, "etag", &etag_value);
- if (!etag_value.empty()) {
- size_t slash = etag_value.find('/');
- if (slash == std::string::npos || slash == 0)
- return true;
-
- std::string::const_iterator i = etag_value.begin();
- std::string::const_iterator j = etag_value.begin() + slash;
- HttpUtil::TrimLWS(&i, &j);
- if (!LowerCaseEqualsASCII(i, j, "w"))
- return true;
- }
-
- Time last_modified;
- if (!GetLastModifiedValue(&last_modified))
- return false;
-
- Time date;
- if (!GetDateValue(&date))
- return false;
-
- return ((date - last_modified).InSeconds() >= 60);
+ std::string etag_header;
+ EnumerateHeader(NULL, "etag", &etag_header);
+ std::string last_modified_header;
+ EnumerateHeader(NULL, "Last-Modified", &last_modified_header);
+ std::string date_header;
+ EnumerateHeader(NULL, "Date", &last_modified_header);
+ return HttpUtil::HasStrongValidators(
+ GetHttpVersion(), etag_header, last_modified_header, date_header);
}
// From RFC 2616:
« no previous file with comments | « no previous file | net/http/http_util.h » ('j') | webkit/media/buffered_resource_loader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698