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

Issue 871853002: ServiceWorker: add ServiceWorkerClients.claim() support (2/3). (Closed)

Created:
5 years, 11 months ago by xiang
Modified:
5 years, 10 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
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ServiceWorker: add ServiceWorkerClients.claim() support (2/3). The claiming registration will fetch all registrations from DB and comparing them with existing provider hosts. If it has the longest match, it will start controlling the provider host. Spec: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#clients-claim (1/3): https://codereview.chromium.org/868463004/ (2/3): This (3/3): https://codereview.chromium.org/872593002/ BUG=450106 TEST=https://codereview.chromium.org/872593002/ Committed: https://crrev.com/afc4f16f4cf1b894cef3c35b806d32ef644ae3b5 Cr-Commit-Position: refs/heads/master@{#314514}

Patch Set 1 : #

Patch Set 2 : change error type #

Total comments: 26

Patch Set 3 : remove should_notify_controllerchange flag #

Total comments: 4

Patch Set 4 : use registration listener #

Patch Set 5 : remove listener #

Total comments: 16

Patch Set 6 : fetch registrations from DB #

Total comments: 9

Patch Set 7 : address comments, rebase #

Patch Set 8 : remove assignment within conditional expression #

Unified diffs Side-by-side diffs Delta from patch set Stats (+221 lines, -11 lines) Patch
M content/browser/notifications/notification_event_dispatcher_impl.cc View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/push_messaging/push_messaging_message_filter.cc View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/push_messaging/push_messaging_router.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.cc View 1 2 3 4 5 6 4 chunks +16 lines, -5 lines 0 comments Download
M content/browser/service_worker/service_worker_registration.h View 1 2 3 4 5 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_registration.cc View 1 2 3 4 5 6 2 chunks +54 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_registration_status.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_utils_unittest.cc View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 4 5 6 7 4 chunks +48 lines, -0 lines 0 comments Download
M content/child/service_worker/service_worker_dispatcher.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/common/service_worker/service_worker_messages.h View 1 2 3 4 5 6 2 chunks +11 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_status_code.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_status_code.cc View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.h View 1 2 3 4 5 6 2 chunks +1 line, -5 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.cc View 1 2 3 4 5 6 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 5 chunks +12 lines, -0 lines 0 comments Download
M content/renderer/service_worker/service_worker_script_context.cc View 1 2 3 4 5 6 3 chunks +40 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (8 generated)
xiang
PTAL, thanks.
5 years, 11 months ago (2015-01-23 04:59:38 UTC) #3
falken
this is looking pretty good https://codereview.chromium.org/871853002/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/871853002/diff/40001/content/browser/service_worker/service_worker_provider_host.cc#newcode92 content/browser/service_worker/service_worker_provider_host.cc:92: SetControllerVersionAttribute(active_version, true); nit: can ...
5 years, 11 months ago (2015-01-26 08:45:13 UTC) #4
falken
https://codereview.chromium.org/871853002/diff/40001/content/browser/service_worker/service_worker_provider_host.h File content/browser/service_worker/service_worker_provider_host.h (right): https://codereview.chromium.org/871853002/diff/40001/content/browser/service_worker/service_worker_provider_host.h#newcode145 content/browser/service_worker/service_worker_provider_host.h:145: void SetController(ServiceWorkerRegistration* registration); On 2015/01/26 08:45:13, falken wrote: > ...
5 years, 11 months ago (2015-01-26 08:45:41 UTC) #5
michaeln
https://codereview.chromium.org/871853002/diff/40001/content/browser/service_worker/service_worker_provider_host.h File content/browser/service_worker/service_worker_provider_host.h (right): https://codereview.chromium.org/871853002/diff/40001/content/browser/service_worker/service_worker_provider_host.h#newcode99 content/browser/service_worker/service_worker_provider_host.h:99: bool should_notify_controller_change = false); This flag seems odd? Also ...
5 years, 11 months ago (2015-01-28 00:55:14 UTC) #6
xiang
Thanks for the review! CL updated, PTAL. I have removed the should_notify_controllerchange flag, a UseRegistration() ...
5 years, 10 months ago (2015-01-28 05:38:35 UTC) #8
falken
https://codereview.chromium.org/871853002/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/871853002/diff/40001/content/browser/service_worker/service_worker_provider_host.cc#newcode254 content/browser/service_worker/service_worker_provider_host.cc:254: if (associated_registration_ == registration) { On 2015/01/28 05:38:35, xiang ...
5 years, 10 months ago (2015-01-28 08:59:50 UTC) #9
michaeln
https://codereview.chromium.org/871853002/diff/40001/content/browser/service_worker/service_worker_registration.cc File content/browser/service_worker/service_worker_registration.cc (right): https://codereview.chromium.org/871853002/diff/40001/content/browser/service_worker/service_worker_registration.cc#newcode178 content/browser/service_worker/service_worker_registration.cc:178: for (std::vector<ServiceWorkerRegistrationInfo>::iterator it = On 2015/01/28 08:59:49, falken wrote: ...
5 years, 10 months ago (2015-01-28 21:11:14 UTC) #10
xiang
Some comments before I update the CL. I'm not sure on the registration match impl(better ...
5 years, 10 months ago (2015-01-29 02:58:38 UTC) #11
falken
> I'm not sure on the registration match impl(better than current v.s. better than > ...
5 years, 10 months ago (2015-01-29 03:28:51 UTC) #12
xiang
On 2015/01/29 03:28:51, falken wrote: > > I'm not sure on the registration match impl(better ...
5 years, 10 months ago (2015-01-29 06:23:48 UTC) #13
xiang
Update the CL again, as previous one has an obvious error. I think we still ...
5 years, 10 months ago (2015-01-29 09:06:40 UTC) #14
falken
This basically looks good to me. I think there's some better refactoring of (Can)(Dis)AssociateRegistration and ...
5 years, 10 months ago (2015-01-29 15:10:38 UTC) #15
michaeln
This looks pretty good to me too. https://codereview.chromium.org/871853002/diff/110001/content/browser/service_worker/service_worker_provider_host.h File content/browser/service_worker/service_worker_provider_host.h (right): https://codereview.chromium.org/871853002/diff/110001/content/browser/service_worker/service_worker_provider_host.h#newcode175 content/browser/service_worker/service_worker_provider_host.h:175: void SetControllerVersionAttribute(ServiceWorkerVersion* ...
5 years, 10 months ago (2015-01-29 22:35:34 UTC) #16
xiang
Thanks for the review. PTAL. As michaeln@ commented, depends on live registrations is not safe ...
5 years, 10 months ago (2015-01-30 07:18:57 UTC) #18
falken
It's unfortunate that claim() hits DB before doing anything but we can land and iterate. ...
5 years, 10 months ago (2015-01-30 10:24:02 UTC) #19
michaeln
>> I think FindRegistrationForDocument would return 'this' over a >> registration that does not yet ...
5 years, 10 months ago (2015-01-30 23:43:07 UTC) #20
michaeln
On 2015/01/30 23:43:07, michaeln wrote: > >> I think FindRegistrationForDocument would return 'this' over a ...
5 years, 10 months ago (2015-01-30 23:43:51 UTC) #21
xiang
Thank you for the review! I filed a crbug for DB access at: http://code.google.com/p/chromium/issues/detail?id=454250 I ...
5 years, 10 months ago (2015-02-02 04:24:59 UTC) #22
xiang
johnme@ would you please help to review: content/browser/push_messaging/ changes? mkwst@ would you please help to ...
5 years, 10 months ago (2015-02-02 04:40:10 UTC) #24
Mike West
IPC LGTM.
5 years, 10 months ago (2015-02-02 08:33:53 UTC) #25
xiang
On 2015/02/02 04:40:10, xiang wrote: > johnme@ would you please help to review: content/browser/push_messaging/ > ...
5 years, 10 months ago (2015-02-03 06:33:07 UTC) #26
mlamouri (slow - plz ping)
On 2015/02/03 at 06:33:07, xiang.long wrote: > On 2015/02/02 04:40:10, xiang wrote: > > johnme@ ...
5 years, 10 months ago (2015-02-03 09:41:00 UTC) #27
johnme
rubber stamp lgtm
5 years, 10 months ago (2015-02-03 09:59:20 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/871853002/170001
5 years, 10 months ago (2015-02-04 05:12:13 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: win_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu/builds/118993)
5 years, 10 months ago (2015-02-04 05:44:25 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/871853002/190001
5 years, 10 months ago (2015-02-04 06:09:27 UTC) #34
commit-bot: I haz the power
Committed patchset #8 (id:190001)
5 years, 10 months ago (2015-02-04 07:05:27 UTC) #35
commit-bot: I haz the power
5 years, 10 months ago (2015-02-04 07:06:21 UTC) #36
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/afc4f16f4cf1b894cef3c35b806d32ef644ae3b5
Cr-Commit-Position: refs/heads/master@{#314514}

Powered by Google App Engine
This is Rietveld 408576698