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

Issue 1439333002: Service Worker: Add Clients.get(id) (Closed)

Created:
5 years, 1 month ago by jungkees
Modified:
4 years, 10 months ago
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, mlamouri+watch-content_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, blink-reviews, dglazkov+blink, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, horo+watch_chromium.org, kinuko+watch, blink-reviews-api_chromium.org, blink-worker-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Service Worker: Add Clients.get(id) As per the latest spec update, this CL implements Clients.get(id) method. Spec discussion: https://github.com/slightlyoff/ServiceWorker/issues/723#issuecomment-151326898 Spec: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#clients-get-method Intent to implement and ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/XlBHOIOCjUk The layout tests for this CL are mostly taken from Mozilla's work instead of making new ones to ensure compatibility: https://bugzilla.mozilla.org/show_bug.cgi?id=1222464 BUG=552310 Committed: https://crrev.com/0ca977be9dbe2582e8f18415bd9299efd36fd329 Cr-Commit-Position: refs/heads/master@{#376870}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Make it resolve with a WindowClient object for window type clients #

Patch Set 4 : Add layout test #

Total comments: 5

Patch Set 5 : Rebase and import layout tests #

Patch Set 6 : Fix it to get WindowClient info in the UI thread #

Patch Set 7 : Use HTTP origins instead of HTTPS origins for layout tests #

Total comments: 34

Patch Set 8 : Address comments #

Total comments: 40

Patch Set 9 : Filter out off-origin match; fix layout test #

Total comments: 16

Patch Set 10 : Rebase; address comments #

Total comments: 42

Patch Set 11 : Move the origin check lines and update layout tests #

Total comments: 7

Patch Set 12 : Simlify call flow and remove redundant params #

Total comments: 8

Patch Set 13 : Fix layout test and add null client check #

Total comments: 2

Patch Set 14 : Remove unnecessary condition #

Unified diffs Side-by-side diffs Delta from patch set Stats (+495 lines, -75 lines) Patch
M content/browser/service_worker/service_worker_client_utils.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +9 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_client_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +54 lines, -16 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.h View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.cc View 1 2 3 4 5 5 chunks +11 lines, -8 lines 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +8 lines, -5 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +34 lines, -30 lines 0 comments Download
M content/common/service_worker/service_worker_client_info.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -2 lines 0 comments Download
M content/common/service_worker/service_worker_client_info.cc View 1 2 3 4 5 6 7 1 chunk +12 lines, -8 lines 0 comments Download
M content/common/service_worker/service_worker_messages.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 lines, -0 lines 0 comments Download
M content/renderer/service_worker/service_worker_context_client.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -0 lines 0 comments Download
M content/renderer/service_worker/service_worker_context_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +33 lines, -3 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +69 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get-cross-origin.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +48 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-cross-origin-frame.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +58 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-frame.html View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-worker.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +42 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/Clients.idl View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +45 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextClient.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 54 (11 generated)
jungkees
I uploaded a snapshot ready for review. PTAL.
4 years, 11 months ago (2016-01-04 07:41:16 UTC) #4
zino
This is a small feature but webexposed. So, you need to send a intent to ...
4 years, 11 months ago (2016-01-04 09:05:27 UTC) #5
zino
Sorry for confusing. This CL isn't lgtm yet. My previous comments included l-g-t-m keyword.
4 years, 11 months ago (2016-01-04 09:08:11 UTC) #6
zino
Sorry for confusing repeatedly. This CL isn't l-g-t-m yet. My previous comments included l-g-t-m keyword. ...
4 years, 11 months ago (2016-01-04 09:09:26 UTC) #7
falken
Thanks for working on this. Some high-level comments: - I recommend an "intent to implement ...
4 years, 11 months ago (2016-01-05 05:16:52 UTC) #8
zino
Jungkee, I think some logic has to move to new service_worker_client_utils.cc. Please see: https://codereview.chromium.org/1535983002
4 years, 11 months ago (2016-01-05 05:38:30 UTC) #9
jungkees
Thanks for the reviews, zino@, falken@. I'll address them. > - I recommend an "intent ...
4 years, 11 months ago (2016-01-05 06:59:26 UTC) #10
falken
On 2016/01/05 06:59:26, jungkees wrote: > Thanks for the reviews, zino@, falken@. I'll address them. ...
4 years, 11 months ago (2016-01-05 07:01:32 UTC) #11
jungkees
Sure. Thanks!
4 years, 11 months ago (2016-01-05 07:03:03 UTC) #12
falken
Is this ready for reviwe?
4 years, 11 months ago (2016-01-26 01:51:28 UTC) #13
jungkees
The implementation is mostly done, but I've seen an error case with the imported layout ...
4 years, 11 months ago (2016-01-26 05:31:33 UTC) #14
falken
On 2016/01/26 05:31:33, jungkees wrote: > The implementation is mostly done, but I've seen an ...
4 years, 10 months ago (2016-02-03 01:07:16 UTC) #15
jungkees
I was just working on it :) With the patch set 6, the crashing issue ...
4 years, 10 months ago (2016-02-03 05:07:48 UTC) #16
jungkees
I uploaded a new snapshot having resolved the layout test issues. PTAL
4 years, 10 months ago (2016-02-03 06:58:45 UTC) #19
nhiroki
(I reviewed this CL on behalf of falken@ because he will be ooo for a ...
4 years, 10 months ago (2016-02-03 09:40:00 UTC) #20
jungkees
Thanks a lot for your review, nhiroki@! I uploaded a new snapshot having addressed those ...
4 years, 10 months ago (2016-02-03 14:15:08 UTC) #21
Mike West
I'll defer the serviceworker pieces of the review to nhiroki@, et al. The IPC changes ...
4 years, 10 months ago (2016-02-04 18:17:44 UTC) #22
zino
https://codereview.chromium.org/1439333002/diff/160001/content/browser/service_worker/service_worker_client_utils.cc File content/browser/service_worker/service_worker_client_utils.cc (right): https://codereview.chromium.org/1439333002/diff/160001/content/browser/service_worker/service_worker_client_utils.cc#newcode395 content/browser/service_worker/service_worker_client_utils.cc:395: provider_host->GetWindowClientInfo(base::Bind(&DidGetClient, callback)); If you use GetClientInfoCallback, you can pass ...
4 years, 10 months ago (2016-02-05 06:21:44 UTC) #23
nhiroki
https://codereview.chromium.org/1439333002/diff/140001/third_party/WebKit/Source/modules/serviceworkers/Clients.idl File third_party/WebKit/Source/modules/serviceworkers/Clients.idl (right): https://codereview.chromium.org/1439333002/diff/140001/third_party/WebKit/Source/modules/serviceworkers/Clients.idl#newcode11 third_party/WebKit/Source/modules/serviceworkers/Clients.idl:11: [CallWith=ScriptState] Promise<any> get(DOMString id); On 2016/02/03 14:15:07, jungkees wrote: ...
4 years, 10 months ago (2016-02-08 06:27:03 UTC) #24
jungkees
Thanks for the reivew! While having worked on the layout test fix, I noticed I ...
4 years, 10 months ago (2016-02-12 15:03:22 UTC) #25
nhiroki
https://codereview.chromium.org/1439333002/diff/140001/content/browser/service_worker/service_worker_client_utils.cc File content/browser/service_worker/service_worker_client_utils.cc (right): https://codereview.chromium.org/1439333002/diff/140001/content/browser/service_worker/service_worker_client_utils.cc#newcode398 content/browser/service_worker/service_worker_client_utils.cc:398: provider_host->GetWindowClientInfo(callback); On 2016/02/03 14:15:07, jungkees wrote: > Right. Addressed. ...
4 years, 10 months ago (2016-02-16 06:09:31 UTC) #26
jungkees
I uploaded a new snapshot having addressed the comments. PTAL https://codereview.chromium.org/1439333002/diff/140001/content/browser/service_worker/service_worker_client_utils.cc File content/browser/service_worker/service_worker_client_utils.cc (right): https://codereview.chromium.org/1439333002/diff/140001/content/browser/service_worker/service_worker_client_utils.cc#newcode398 ...
4 years, 10 months ago (2016-02-16 16:28:58 UTC) #27
nhiroki
Looks good :) https://codereview.chromium.org/1439333002/diff/200001/content/browser/service_worker/service_worker_client_utils.cc File content/browser/service_worker/service_worker_client_utils.cc (right): https://codereview.chromium.org/1439333002/diff/200001/content/browser/service_worker/service_worker_client_utils.cc#newcode418 content/browser/service_worker/service_worker_client_utils.cc:418: controller->script_url().GetOrigin()) { This origin check should ...
4 years, 10 months ago (2016-02-17 02:40:28 UTC) #28
jungkees
Thanks you for the review! I uploaded a new snapshot having addressed the comments. PTAL ...
4 years, 10 months ago (2016-02-17 14:01:13 UTC) #29
zino
https://codereview.chromium.org/1439333002/diff/200001/third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html (right): https://codereview.chromium.org/1439333002/diff/200001/third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html#newcode68 third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html:68: service_worker_unregister_and_done(t, scope); On 2016/02/17 14:01:12, jungkees wrote: > Without ...
4 years, 10 months ago (2016-02-17 18:38:14 UTC) #30
nhiroki
LGTM after jinho.bang@'s comments are addressed. Thank you for working on this :) https://codereview.chromium.org/1439333002/diff/200001/third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html File ...
4 years, 10 months ago (2016-02-18 01:40:27 UTC) #31
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1439333002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1439333002/220001
4 years, 10 months ago (2016-02-18 02:09:53 UTC) #33
nhiroki
https://codereview.chromium.org/1439333002/diff/200001/third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html (right): https://codereview.chromium.org/1439333002/diff/200001/third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html#newcode1 third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-get.html:1: <!DOCTYPE html> On 2016/02/18 01:40:27, nhiroki wrote: > This ...
4 years, 10 months ago (2016-02-18 02:18:09 UTC) #34
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: cast_shell_android on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_android/builds/23299) chromeos_daisy_chromium_compile_only_ng on ...
4 years, 10 months ago (2016-02-18 02:30:50 UTC) #36
nhiroki
fyi: mkwst@, I think you can now start to review this CL: - content/common/service_worker/service_worker_messages.h - ...
4 years, 10 months ago (2016-02-18 03:08:07 UTC) #37
jungkees
I uploaded a new snapshot having addressed zino@'s comments. nhiroki@, zino@, PTAL again before committing ...
4 years, 10 months ago (2016-02-18 15:02:20 UTC) #38
nhiroki
https://codereview.chromium.org/1439333002/diff/240001/content/renderer/service_worker/service_worker_context_client.cc File content/renderer/service_worker/service_worker_context_client.cc (right): https://codereview.chromium.org/1439333002/diff/240001/content/renderer/service_worker/service_worker_context_client.cc#newcode895 content/renderer/service_worker/service_worker_context_client.cc:895: callbacks->onSuccess(adoptWebPtr(new blink::WebServiceWorkerClientInfo( It looks like this fails compile steps ...
4 years, 10 months ago (2016-02-19 05:18:32 UTC) #39
jungkees
nhiroki@, thanks for the comments. Actually, I'm having a 403 error in uploading snapshots for ...
4 years, 10 months ago (2016-02-19 05:30:02 UTC) #40
Mike West
On 2016/02/18 at 03:08:07, nhiroki wrote: > fyi: mkwst@, I think you can now start ...
4 years, 10 months ago (2016-02-19 06:45:00 UTC) #41
jungkees
I'm figuring out the reason for the timeout error encountered again in clients-get.html after promisifying ...
4 years, 10 months ago (2016-02-19 16:31:43 UTC) #42
jungkees
The timeout error encountered during the layout test update turned out to be caused by ...
4 years, 10 months ago (2016-02-22 05:23:56 UTC) #43
jungkees
I uploaded a new snapshot having addressed the comments. PTAL https://codereview.chromium.org/1439333002/diff/240001/content/renderer/service_worker/service_worker_context_client.cc File content/renderer/service_worker/service_worker_context_client.cc (right): https://codereview.chromium.org/1439333002/diff/240001/content/renderer/service_worker/service_worker_context_client.cc#newcode895 ...
4 years, 10 months ago (2016-02-22 14:05:09 UTC) #44
nhiroki
lgtm https://codereview.chromium.org/1439333002/diff/260001/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp File third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp (right): https://codereview.chromium.org/1439333002/diff/260001/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp#newcode74 third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp:74: if (!client || client->uuid.isEmpty()) { According to the ...
4 years, 10 months ago (2016-02-22 15:59:09 UTC) #45
jungkees
Addressed the comment. Thanks! https://codereview.chromium.org/1439333002/diff/260001/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp File third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp (right): https://codereview.chromium.org/1439333002/diff/260001/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp#newcode74 third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp:74: if (!client || client->uuid.isEmpty()) { ...
4 years, 10 months ago (2016-02-22 23:08:25 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1439333002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1439333002/280001
4 years, 10 months ago (2016-02-22 23:11:12 UTC) #49
zino
non-owner lgtm
4 years, 10 months ago (2016-02-22 23:33:38 UTC) #50
commit-bot: I haz the power
Committed patchset #14 (id:280001)
4 years, 10 months ago (2016-02-23 00:36:43 UTC) #52
commit-bot: I haz the power
4 years, 10 months ago (2016-02-23 00:38:20 UTC) #54
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/0ca977be9dbe2582e8f18415bd9299efd36fd329
Cr-Commit-Position: refs/heads/master@{#376870}

Powered by Google App Engine
This is Rietveld 408576698