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

Unified Diff: net/http/http_cache_transaction.cc

Issue 154243006: Add GetExpirationTimes() to HttpResponseHeader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: elide freshness origin Created 6 years, 10 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_response_headers.h » ('j') | net/http/http_response_headers.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 15ad924df8f846599166ad663f6c01d3b3dbe94c..ee8ea32b970095e4cb949cc1483bcb5339e0c615 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1995,12 +1995,10 @@ bool HttpCache::Transaction::RequiresValidation() {
if (request_->method == "PUT" || request_->method == "DELETE")
return true;
- if (response_.headers->RequiresValidation(
- response_.request_time, response_.response_time, Time::Now())) {
- return true;
- }
-
- return false;
+ const Time freshness_expiry =
+ response_.headers->GetFreshnessExpiry(response_.request_time,
+ response_.response_time);
+ return freshness_expiry <= Time::Now();
}
bool HttpCache::Transaction::ConditionalizeRequest() {
« no previous file with comments | « no previous file | net/http/http_response_headers.h » ('j') | net/http/http_response_headers.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698