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

Issue 1283273002: Service Worker: Change last update check location and HTTP cache bypass rule (2/2) (Closed)

Created:
5 years, 4 months ago by jungkees
Modified:
5 years, 2 months ago
CC:
chromium-reviews, horo, jam, kinuko+serviceworker, kinuko+watch, serviceworker-reviews, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Service Worker: Change last update check location and HTTP cache bypass rule (2/2) As per the last f2f and the follow-up discussion, the registration's last update check time should be updated only when the script load request actually accessed network and received response without a network error. The time stamp should be updated regardless of whether the installation of the fetched resource succeeds or fails. This patch involves the following behavior changes: 1. Before: The last update check time was not updated when the installation of the fetched resouce fails. After: The last update check time is updated regardless of the result of the installation. 2. Before: registration.update() always bypassed HTTP cache. After: registration.update() no longer forces bypassing the HTTP cache but bypasses it only when 24 hours have passed since the last update check, as per spec. Spec: https://github.com/slightlyoff/ServiceWorker/commit/569863f3acd0f5d79beab9d8c63210b8286ee507 Spec discussion: https://github.com/slightlyoff/ServiceWorker/issues/514#issuecomment-135641718 Companion CL (Blink layout test): https://codereview.chromium.org/1288653002/ BUG=520068

Patch Set 1 #

Patch Set 2 : Update comments. #

Total comments: 5

Patch Set 3 : Do not store max-age to database. #

Total comments: 10

Patch Set 4 : Address the latest spec change. #

Total comments: 12

Patch Set 5 : Use |request->response_info().network_accessed| to check network access. #

Total comments: 2

Patch Set 6 : Pass a callback to UpdateScript(). #

Total comments: 4

Patch Set 7 : Add comments. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -64 lines) Patch
M content/browser/service_worker/service_worker_context_core.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_context_wrapper.cc View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host.cc View 1 2 3 1 chunk +1 line, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_job_unittest.cc View 1 2 3 1 chunk +0 lines, -25 lines 0 comments Download
M content/browser/service_worker/service_worker_register_job.cc View 1 2 3 2 chunks +0 lines, -11 lines 0 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job.cc View 1 2 3 4 2 chunks +19 lines, -0 lines 8 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job_unittest.cc View 1 2 3 4 5 6 10 chunks +104 lines, -25 lines 0 comments Download

Messages

Total messages: 37 (7 generated)
jungkees
PTAL.
5 years, 4 months ago (2015-08-12 16:31:37 UTC) #2
falken
This is surprising to me, is it really what we decided? I commented on https://github.com/slightlyoff/ServiceWorker/issues/514
5 years, 4 months ago (2015-08-13 00:43:33 UTC) #4
jungkees
I left a comment in the spec issue. Depending on the decision, I'll apply the ...
5 years, 4 months ago (2015-08-13 01:16:07 UTC) #5
zino
peer review looks good to me
5 years, 4 months ago (2015-08-17 11:38:56 UTC) #6
jungkees
It has been reviewed from the spec perspective too: https://github.com/slightlyoff/ServiceWorker/issues/514#issuecomment-130664373. OWNERs, PTAL.
5 years, 4 months ago (2015-08-17 12:00:41 UTC) #8
nhiroki
Thank you for working on this. I wonder if we don't have to store max-age ...
5 years, 4 months ago (2015-08-19 06:59:01 UTC) #10
jungkees
Thanks for the good point. I'm surely opened to a way not storing max-age value ...
5 years, 4 months ago (2015-08-20 01:52:56 UTC) #11
jungkees
On 2015/08/20 01:52:56, jungkees wrote: > In my understanding, we now consider > min(Cache-Control: max-age's ...
5 years, 4 months ago (2015-08-20 02:19:47 UTC) #12
jungkees
It has been clarified that the spec doesn't want to require any scheduled update based ...
5 years, 4 months ago (2015-08-20 14:44:40 UTC) #15
nhiroki
Sorry for my late reply. https://codereview.chromium.org/1283273002/diff/80001/content/browser/service_worker/embedded_worker_instance.h File content/browser/service_worker/embedded_worker_instance.h (right): https://codereview.chromium.org/1283273002/diff/80001/content/browser/service_worker/embedded_worker_instance.h#newcode143 content/browser/service_worker/embedded_worker_instance.h:143: void set_network_accessed_for_script(bool network_accessed) { ...
5 years, 3 months ago (2015-08-24 07:57:51 UTC) #16
jungkees
Thanks for the review. I'll upload a snapshot once I sort out the related question ...
5 years, 3 months ago (2015-08-25 09:36:51 UTC) #17
nhiroki
https://codereview.chromium.org/1283273002/diff/80001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/1283273002/diff/80001/content/browser/service_worker/service_worker_register_job.cc#newcode348 content/browser/service_worker/service_worker_register_job.cc:348: if (new_version()->embedded_worker()->network_accessed_for_script() || On 2015/08/25 09:36:51, jungkees wrote: > ...
5 years, 3 months ago (2015-08-28 09:19:55 UTC) #18
jungkees
On 2015/08/28 09:19:55, nhiroki wrote: > Thank you for clarifying the spec. The latest spec ...
5 years, 3 months ago (2015-08-28 11:04:45 UTC) #19
jungkees
I uploaded a new snapshot having addressed the latest spec change upon our discussion: - ...
5 years, 3 months ago (2015-09-04 12:56:57 UTC) #21
nhiroki
https://codereview.chromium.org/1283273002/diff/120001/content/browser/service_worker/service_worker_context_core.h File content/browser/service_worker/service_worker_context_core.h (right): https://codereview.chromium.org/1283273002/diff/120001/content/browser/service_worker/service_worker_context_core.h#newcode186 content/browser/service_worker/service_worker_context_core.h:186: // Updates the service worker. If |force_bypass_cache| is true ...
5 years, 3 months ago (2015-09-07 07:05:59 UTC) #22
jungkees
Thanks for the review! I uploaded a new snapshot having addressed the comments. PTAL https://codereview.chromium.org/1283273002/diff/120001/content/browser/service_worker/service_worker_context_core.h ...
5 years, 3 months ago (2015-09-08 16:01:13 UTC) #23
nhiroki
Almost there. https://codereview.chromium.org/1283273002/diff/120001/content/browser/service_worker/service_worker_context_wrapper.cc File content/browser/service_worker/service_worker_context_wrapper.cc (right): https://codereview.chromium.org/1283273002/diff/120001/content/browser/service_worker/service_worker_context_wrapper.cc#newcode393 content/browser/service_worker/service_worker_context_wrapper.cc:393: false /* force_bypass_cache */); On 2015/09/08 16:01:13, ...
5 years, 3 months ago (2015-09-09 08:27:48 UTC) #24
jungkees
Addressed the comment and uploaded a new snapshot. PTAL https://codereview.chromium.org/1283273002/diff/120001/content/browser/service_worker/service_worker_context_wrapper.cc File content/browser/service_worker/service_worker_context_wrapper.cc (right): https://codereview.chromium.org/1283273002/diff/120001/content/browser/service_worker/service_worker_context_wrapper.cc#newcode393 content/browser/service_worker/service_worker_context_wrapper.cc:393: ...
5 years, 3 months ago (2015-09-09 13:13:37 UTC) #25
nhiroki
LGTM! Since the update check is important feature from the aspect of security and availability, ...
5 years, 3 months ago (2015-09-09 14:10:02 UTC) #26
falken
I think this looks good. Can you make the CL description more explicit about the ...
5 years, 3 months ago (2015-09-10 01:29:24 UTC) #27
jungkees
Thanks for the review! I updated the CL description and just uploaded a new snapshot ...
5 years, 3 months ago (2015-09-10 14:54:12 UTC) #28
michaeln
a drive by comment https://codereview.chromium.org/1283273002/diff/180001/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/1283273002/diff/180001/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode655 content/browser/service_worker/service_worker_write_to_cache_job.cc:655: registration->set_last_update_check(base::Time::Now()); I think this logic ...
5 years, 3 months ago (2015-09-10 20:26:46 UTC) #29
jungkees
Thanks for the review. I left my answers and questions inline below. https://codereview.chromium.org/1283273002/diff/180001/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc ...
5 years, 3 months ago (2015-09-11 04:28:14 UTC) #30
falken
On 2015/09/11 04:28:14, jungkees wrote: > Thanks for the review. I left my answers and ...
5 years, 3 months ago (2015-09-11 05:10:21 UTC) #31
jungkees
On 2015/09/11 05:10:21, falken wrote: > On 2015/09/11 04:28:14, jungkees wrote: > > Thanks for ...
5 years, 3 months ago (2015-09-11 05:44:30 UTC) #32
jungkees
And is it better to split the BUG entries too?
5 years, 3 months ago (2015-09-11 05:47:44 UTC) #33
falken
On 2015/09/11 05:47:44, jungkees wrote: > And is it better to split the BUG entries ...
5 years, 3 months ago (2015-09-11 07:53:28 UTC) #34
michaeln
https://codereview.chromium.org/1283273002/diff/180001/content/browser/service_worker/service_worker_write_to_cache_job.cc File content/browser/service_worker/service_worker_write_to_cache_job.cc (right): https://codereview.chromium.org/1283273002/diff/180001/content/browser/service_worker/service_worker_write_to_cache_job.cc#newcode650 content/browser/service_worker/service_worker_write_to_cache_job.cc:650: if (request->response_info().network_accessed) { I'm not sure this matters, but... ...
5 years, 3 months ago (2015-09-11 18:59:27 UTC) #35
jungkees
Sorry for coming back late. Thanks for the review, michaeln@. I just left comments. https://codereview.chromium.org/1283273002/diff/180001/content/browser/service_worker/service_worker_write_to_cache_job.cc ...
5 years, 3 months ago (2015-09-22 01:23:40 UTC) #36
jungkees
5 years, 2 months ago (2015-10-06 02:05:54 UTC) #37
Message was sent while issue was closed.
Closing this CL in favor of:
https://codereview.chromium.org/1380323002/ (Landed)
https://codereview.chromium.org/1381153004/ (WIP)

Powered by Google App Engine
This is Rietveld 408576698