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

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

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: fix tests Created 3 years, 9 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 867752162c373d591d87763817ec2e62387f86d9..97116c331be704ac490489a10b8ee595006d7b53 100644
--- a/content/browser/service_worker/service_worker_context_request_handler.cc
+++ b/content/browser/service_worker/service_worker_context_request_handler.cc
@@ -209,9 +209,11 @@ net::URLRequestJob* ServiceWorkerContextRequestHandler::MaybeCreateJobImpl(
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()) {
+ version_->force_bypass_cache_for_scripts() ||
+ !registration->use_cache()) {
extra_load_flags = net::LOAD_BYPASS_CACHE;
}

Powered by Google App Engine
This is Rietveld 408576698