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

Unified Diff: net/url_request/sdch_dictionary_fetcher.cc

Issue 154243006: Add GetExpirationTimes() to HttpResponseHeader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move a function body Created 4 years, 8 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
Index: net/url_request/sdch_dictionary_fetcher.cc
diff --git a/net/url_request/sdch_dictionary_fetcher.cc b/net/url_request/sdch_dictionary_fetcher.cc
index e8eb3268e4a8db861a8cdf1ac5f759b1aa01729a..5bbcb90016c5c6931c83b955bd855490bb4e3acc 100644
--- a/net/url_request/sdch_dictionary_fetcher.cc
+++ b/net/url_request/sdch_dictionary_fetcher.cc
@@ -167,12 +167,13 @@ void SdchDictionaryFetcher::OnResponseStarted(URLRequest* request) {
HttpResponseHeaders* response_headers = request->response_headers();
int result = request->status().error();
if (result == OK && response_headers) {
- ValidationType validation_type = response_headers->RequiresValidation(
- request->response_info().request_time,
- request->response_info().response_time, base::Time::Now());
- // TODO(rdsmith): Maybe handle VALIDATION_ASYNCHRONOUS by queueing
- // a non-reload request for the dictionary.
- if (validation_type != VALIDATION_NONE)
+ HttpResponseHeaders::ExpirationTimes expirations =
+ response_headers->GetExpirationTimes(
+ request->response_info().request_time,
+ request->response_info().response_time);
+ // TODO(rdsmith): Maybe handle stale resources by queueing a non-reload
+ // request for the dictionary.
+ if (base::Time::Now() >= expirations.GetExpirationTime())
result = ERR_FAILED;
}
« net/http/http_response_headers.cc ('K') | « net/http/http_response_headers_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698