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

Issue 717353004: ServiceWorker: Add support for .skipWaiting and controllerchange event(2/3) (Closed)

Created:
6 years, 1 month ago by xiang
Modified:
5 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, horo+watch_chromium.org, jam, jsbell+serviceworker_chromium.org, kinuko+serviceworker, mkwst+moarreviews-renderer_chromium.org, nhiroki, serviceworker-reviews, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

ServiceWorker: Add support for .skipWaiting and controllerchange event(2/3) The ServiceWorkerScriptContext will handle .skipWaiting request by sending an IPC message to browser process. The message will be handled by ServiceWorkerVersion. Currently we will only affect controllees using the same registration of the worker. Spec: http://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-global-scope-skipwaiting https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-container-controllerchange-event (1/3): https://codereview.chromium.org/723923002/ (2/3): This (3/3): https://codereview.chromium.org/765323002/ BUG=370742 Committed: https://crrev.com/979efbd4faa3adc0454cb7b27c16665af4e0204c Cr-Commit-Position: refs/heads/master@{#307862}

Patch Set 1 #

Patch Set 2 : add missing '!' #

Total comments: 15

Patch Set 3 : do not replace other registerations #

Total comments: 12

Patch Set 4 : review update #

Total comments: 6

Patch Set 5 : rebase & add should_notify_controllerchange #

Total comments: 7

Patch Set 6 : review update #

Total comments: 7

Patch Set 7 : style fix #

Patch Set 8 : rebase #

Patch Set 9 : rebase again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -24 lines) Patch
M content/browser/service_worker/service_worker_provider_host.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.cc View 1 2 3 4 5 6 7 8 3 chunks +15 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_register_job.cc View 1 2 1 chunk +3 lines, -4 lines 0 comments Download
M content/browser/service_worker/service_worker_registration.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_registration.cc View 1 2 3 4 5 6 7 4 chunks +13 lines, -9 lines 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 4 5 6 7 8 4 chunks +30 lines, -0 lines 0 comments Download
M content/child/service_worker/service_worker_dispatcher.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M content/child/service_worker/service_worker_dispatcher.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/child/service_worker/service_worker_message_filter.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M content/child/service_worker/service_worker_message_filter.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M content/child/service_worker/web_service_worker_provider_impl.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M content/common/service_worker/service_worker_messages.h View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -2 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.cc View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M content/renderer/service_worker/service_worker_script_context.h View 1 2 3 4 5 6 7 8 5 chunks +8 lines, -0 lines 0 comments Download
M content/renderer/service_worker/service_worker_script_context.cc View 1 2 3 4 5 6 7 8 3 chunks +21 lines, -0 lines 0 comments Download

Messages

Total messages: 48 (16 generated)
xiang
PTAL, thanks! Currently there's a little difference between the impl and the spec. The spec ...
6 years, 1 month ago (2014-11-13 07:35:10 UTC) #2
michaeln
i'll take a closer look, but wanted to get this comment back first... https://codereview.chromium.org/717353004/diff/20001/content/browser/service_worker/service_worker_registration.cc File ...
6 years, 1 month ago (2014-11-14 02:05:11 UTC) #3
falken
https://codereview.chromium.org/717353004/diff/20001/content/browser/service_worker/service_worker_registration.cc File content/browser/service_worker/service_worker_registration.cc (right): https://codereview.chromium.org/717353004/diff/20001/content/browser/service_worker/service_worker_registration.cc#newcode262 content/browser/service_worker/service_worker_registration.cc:262: host->active_version(); You can add "1. Let exitingWorker be the ...
6 years, 1 month ago (2014-11-14 04:00:15 UTC) #4
xiang
https://codereview.chromium.org/717353004/diff/20001/content/browser/service_worker/service_worker_registration.cc File content/browser/service_worker/service_worker_registration.cc (right): https://codereview.chromium.org/717353004/diff/20001/content/browser/service_worker/service_worker_registration.cc#newcode271 content/browser/service_worker/service_worker_registration.cc:271: exiting_version->SetStatus(ServiceWorkerVersion::REDUNDANT); On 2014/11/14 04:00:15, falken wrote: > On 2014/11/14 ...
6 years, 1 month ago (2014-11-14 13:17:28 UTC) #5
michaeln
https://codereview.chromium.org/717353004/diff/20001/content/browser/service_worker/service_worker_registration.cc File content/browser/service_worker/service_worker_registration.cc (right): https://codereview.chromium.org/717353004/diff/20001/content/browser/service_worker/service_worker_registration.cc#newcode271 content/browser/service_worker/service_worker_registration.cc:271: exiting_version->SetStatus(ServiceWorkerVersion::REDUNDANT); > Yes, a longer matched registration should not ...
6 years, 1 month ago (2014-11-14 23:06:39 UTC) #6
xiang
Thanks for the review, before https://github.com/slightlyoff/ServiceWorker/issues/561 has a conclusion I changed the CL to follow ...
6 years, 1 month ago (2014-11-17 08:42:10 UTC) #7
falken
looking pretty good https://codereview.chromium.org/717353004/diff/40001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/717353004/diff/40001/content/browser/service_worker/service_worker_provider_host.cc#newcode60 content/browser/service_worker/service_worker_provider_host.cc:60: CHECK_EQ(associated_registration_.get(), registration); seems DCHECK_EQ is OK ...
6 years, 1 month ago (2014-11-19 04:19:56 UTC) #8
xiang
Thanks for the review, patch updated. Btw, what's your idea about the use case: https://github.com/slightlyoff/ServiceWorker/issues/561/#issuecomment-63409739? ...
6 years ago (2014-11-24 07:04:01 UTC) #9
falken
I think this looks good, but please address michaeln's comment on the Blink-side CL. https://codereview.chromium.org/717353004/diff/60001/content/browser/service_worker/service_worker_registration.cc ...
6 years ago (2014-11-25 09:25:02 UTC) #10
falken
> Btw, what's your idea about the use case: > https://github.com/slightlyoff/ServiceWorker/issues/561/#issuecomment-63409739? Forgot to respond to ...
6 years ago (2014-11-25 15:50:46 UTC) #11
michaeln
i like how this is shaping up too https://codereview.chromium.org/717353004/diff/60001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/717353004/diff/60001/content/browser/service_worker/service_worker_provider_host.cc#newcode90 content/browser/service_worker/service_worker_provider_host.cc:90: dispatcher_host_->Send(new ...
6 years ago (2014-11-25 23:50:22 UTC) #12
falken
https://codereview.chromium.org/717353004/diff/60001/content/browser/service_worker/service_worker_registration.cc File content/browser/service_worker/service_worker_registration.cc (right): https://codereview.chromium.org/717353004/diff/60001/content/browser/service_worker/service_worker_registration.cc#newcode226 content/browser/service_worker/service_worker_registration.cc:226: DCHECK(!exiting_version->HasControllee()); Can't this DCHECK fail in the skip waiting ...
6 years ago (2014-11-27 03:40:40 UTC) #13
xiang
Thanks for the review! CL updated, PTAL. https://codereview.chromium.org/717353004/diff/60001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/717353004/diff/60001/content/browser/service_worker/service_worker_provider_host.cc#newcode90 content/browser/service_worker/service_worker_provider_host.cc:90: dispatcher_host_->Send(new ServiceWorkerMsg_SetControllerServiceWorker( ...
6 years ago (2014-11-28 08:04:26 UTC) #15
falken
looks good, I think it needs to be a three-sided patch though, something like: (1) ...
6 years ago (2014-12-01 02:29:59 UTC) #16
xiang
CL updated, PTAL, thanks! https://codereview.chromium.org/717353004/diff/100001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/717353004/diff/100001/content/browser/service_worker/service_worker_provider_host.cc#newcode92 content/browser/service_worker/service_worker_provider_host.cc:92: should_notify_controllerchange = true; On 2014/12/01 ...
6 years ago (2014-12-01 07:20:07 UTC) #17
falken
Please remove "When there are controllees using different registrations, we should also make these workers ...
6 years ago (2014-12-01 07:27:52 UTC) #18
michaeln
fwiw, lgtm 2
6 years ago (2014-12-01 23:43:15 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/717353004/120001
6 years ago (2014-12-03 23:53:22 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/28097)
6 years ago (2014-12-03 23:58:39 UTC) #23
xiang
dcheng@ would you please review the IPC change? thanks.
6 years ago (2014-12-04 00:08:35 UTC) #25
dcheng
I need to take a more in-depth look, but here are some immediate thoughts. https://codereview.chromium.org/717353004/diff/120001/content/browser/service_worker/service_worker_provider_host.cc ...
6 years ago (2014-12-04 00:17:09 UTC) #26
xiang
Would you please take a look again? Thanks! https://codereview.chromium.org/717353004/diff/120001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/717353004/diff/120001/content/browser/service_worker/service_worker_provider_host.cc#newcode91 content/browser/service_worker/service_worker_provider_host.cc:91: previous_version.get() ...
6 years ago (2014-12-04 07:51:37 UTC) #27
xiang
dcheng@ ping, PTAL, thanks!
6 years ago (2014-12-09 05:43:07 UTC) #28
xiang
On 2014/12/09 05:43:07, xiang wrote: > dcheng@ ping, PTAL, thanks! mkwst@ would you help to ...
6 years ago (2014-12-10 06:03:58 UTC) #30
dcheng
ipc changes lgtm. sorry for the delay.
6 years ago (2014-12-10 21:20:54 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/717353004/160001
6 years ago (2014-12-11 02:13:06 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/717353004/180001
6 years ago (2014-12-11 03:12:29 UTC) #37
commit-bot: I haz the power
Failed to apply patch for content/browser/service_worker/service_worker_version.cc: While running git apply --index -3 -p1; error: patch ...
6 years ago (2014-12-11 04:17:19 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/717353004/180001
6 years ago (2014-12-11 04:22:31 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/717353004/200001
6 years ago (2014-12-11 04:29:26 UTC) #46
commit-bot: I haz the power
Committed patchset #9 (id:200001)
6 years ago (2014-12-11 05:24:30 UTC) #47
commit-bot: I haz the power
6 years ago (2014-12-11 05:25:58 UTC) #48
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/979efbd4faa3adc0454cb7b27c16665af4e0204c
Cr-Commit-Position: refs/heads/master@{#307862}

Powered by Google App Engine
This is Rietveld 408576698