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

Unified Diff: content/browser/service_worker/service_worker_register_job.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: Do not store max-age to database. 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_register_job.cc
diff --git a/content/browser/service_worker/service_worker_register_job.cc b/content/browser/service_worker/service_worker_register_job.cc
index 16a192858271e92bc9532362686253dc9bb308fb..ee8887a1b4dfdb3fe89ecb1c18830e02632ca7e2 100644
--- a/content/browser/service_worker/service_worker_register_job.cc
+++ b/content/browser/service_worker/service_worker_register_job.cc
@@ -345,10 +345,7 @@ void ServiceWorkerRegisterJob::OnStartWorkerFinished(
// The updated worker is identical to the incumbent.
if (status == SERVICE_WORKER_ERROR_EXISTS) {
// Only bump the last check time when we've bypassed the browser cache.
- base::TimeDelta time_since_last_check =
- base::Time::Now() - registration()->last_update_check();
- if (time_since_last_check > base::TimeDelta::FromHours(
- kServiceWorkerScriptMaxCacheAgeInHours) ||
+ if (new_version()->embedded_worker()->network_accessed_for_script() ||
nhiroki 2015/08/24 07:57:51 This could break some content_unittests?
jungkees 2015/08/25 09:36:51 Ah yes.. I found ServiceWorkerJobTest.Update_BumpL
nhiroki 2015/08/28 09:19:55 Thank you for clarifying the spec. The latest spec
jungkees 2015/09/04 12:56:57 As per the latest spec change, I moved this part t
new_version()->force_bypass_cache_for_scripts()) {
nhiroki 2015/08/24 07:57:51 This second condition seems no longer necessary be
jungkees 2015/08/25 09:36:51 Yes. I'll remove this second condition.
registration()->set_last_update_check(base::Time::Now());
context_->storage()->UpdateLastUpdateCheckTime(registration());

Powered by Google App Engine
This is Rietveld 408576698