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

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: %zu is win-unfriendly; use %PRIuS instead. 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 | « content/content_tests.gypi ('k') | net/http/http_util.h » ('j') | no next file with comments »
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..c03fbe9bd5e73892f6deca8a79180ccf72733c08 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -1160,32 +1160,16 @@ 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", &date_header);
+ return HttpUtil::HasStrongValidators(GetHttpVersion(),
+ etag_header,
+ last_modified_header,
+ date_header);
}
// From RFC 2616:
« no previous file with comments | « content/content_tests.gypi ('k') | net/http/http_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698