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

Unified Diff: content/browser/service_worker/service_worker_context_request_handler.cc

Issue 1283273002: Service Worker: Change last update check location and HTTP cache bypass rule (2/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments. Created 5 years, 4 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: content/browser/service_worker/service_worker_context_request_handler.cc
diff --git a/content/browser/service_worker/service_worker_context_request_handler.cc b/content/browser/service_worker/service_worker_context_request_handler.cc
index 8d518857c79106c584fbfa91df23c5d5b82cea8d..206bace9f71e605e541896a9a299adacaf4f03dd 100644
--- a/content/browser/service_worker/service_worker_context_request_handler.cc
+++ b/content/browser/service_worker/service_worker_context_request_handler.cc
@@ -64,16 +64,14 @@ net::URLRequestJob* ServiceWorkerContextRequestHandler::MaybeCreateJob(
if (response_id == kInvalidServiceWorkerResponseId)
return NULL;
- // Bypass the browser cache for initial installs and update
- // checks after 24 hours have passed.
+ // Bypass the browser cache for initial installs and update checks after
+ // min(Cache-Control's max-age value, 86400) seconds have passed.
int extra_load_flags = 0;
base::TimeDelta time_since_last_check =
base::Time::Now() - registration->last_update_check();
- if (time_since_last_check > base::TimeDelta::FromHours(
- kServiceWorkerScriptMaxCacheAgeInHours) ||
- version_->force_bypass_cache_for_scripts()) {
+ if (time_since_last_check > version_->max_age() ||
nhiroki 2015/08/19 06:59:01 The original code (time_since_last_check > FromHou
jungkees 2015/08/20 01:52:56 Agreed on your point. Having double-checked the lo
+ version_->force_bypass_cache_for_scripts())
extra_load_flags = net::LOAD_BYPASS_CACHE;
- }
ServiceWorkerVersion* stored_version = registration->waiting_version()
? registration->waiting_version()

Powered by Google App Engine
This is Rietveld 408576698