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

Issue 2653493009: Add two interfaces for ServiceWorkerProviderContext/ProviderHost (Closed)

Created:
3 years, 11 months ago by shimazu
Modified:
3 years, 6 months ago
Reviewers:
falken, Tom Sepez, kinuko
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, viettrungluu+watch_chromium.org, qsr+mojo_chromium.org, shimazu+serviceworker_chromium.org, serviceworker-reviews, jam, nhiroki, abarth-chromium, Aaron Boodman, kinuko+serviceworker, yzshen+watch_chromium.org, horo+watch_chromium.org, darin-cc_chromium.org, kinuko+watch, tzik, darin (slow to review), blink-worker-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add two interfaces for ServiceWorkerProviderContext/ProviderHost This patch introduces two mojom types: ServiceWorkerProviderHost and ServiceWorkerProvider. They are currently used for managing the lifetime of ServiceWorkerProviderHost from the renderer, but these interfaces will have methods managing registrations, registration associated by the document and controller. These interfaces are now associated with SWDispatcherHost which is already bound with the channel. After crrev.com/2779763004, interfaces for worker's context will be associated with EWInstanceClient. This will solve the ordering issue between messages of Stopped and ProviderDestroyed. BUG=629701, 676983, 668633 Review-Url: https://codereview.chromium.org/2653493009 Cr-Commit-Position: refs/heads/master@{#475809} Committed: https://chromium.googlesource.com/chromium/src/+/4223216d2fa2a111c5e0636017bb6766682adda9

Patch Set 1 #

Patch Set 2 : Move some part to the first patch #

Patch Set 3 : fix a nit #

Patch Set 4 : Compile content_unittests but it's still failing #

Patch Set 5 : Pass ServiceWorkerDispatcherHostTest.ProviderCreatedAndDestroyed #

Patch Set 6 : Rebased and added an unittest #

Patch Set 7 : Rebase #

Total comments: 18

Patch Set 8 : Fixed cross-site transferring and rebased #

Patch Set 9 : Bound with the remote provider when PlzNavigate is enabled #

Patch Set 10 : Rebase #

Patch Set 11 : Addressed falken's comments #

Patch Set 12 : Not to bind endpoints in ctor for PlzNavigate and destroy endpoints on IO thread #

Patch Set 13 : . #

Patch Set 14 : Rebased/Fixed unittests when BrowserSideNavigation is enabled #

Total comments: 31

Patch Set 15 : Split the refactor of SWProviderHostInfo from this patch #

Patch Set 16 : Rebased #

Patch Set 17 : Split the refactor of CrossSiteTransfer from this patch #

Patch Set 18 : Addressed comments from falken #

Total comments: 24

Patch Set 19 : Addressed comments from falken #

Patch Set 20 : Rebased #

Total comments: 13

Patch Set 21 : Updated comments #

Patch Set 22 : Missed a comment #

Total comments: 10

Patch Set 23 : Rebased #

Total comments: 7

Patch Set 24 : Updated comments and fixed a mistake of rebasing #

Patch Set 25 : Skip unittest for CrossSiteTransfer when PlzNavigate #

Unified diffs Side-by-side diffs Delta from patch set Stats (+548 lines, -144 lines) Patch
M content/browser/service_worker/embedded_worker_test_helper.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_test_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -2 lines 0 comments Download
M content/browser/service_worker/foreign_fetch_request_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +7 lines, -2 lines 0 comments Download
M content/browser/service_worker/link_header_support_unittest.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +14 lines, -5 lines 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +7 lines, -4 lines 0 comments Download
M content/browser/service_worker/service_worker_context_request_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_context_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +15 lines, -10 lines 0 comments Download
M content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -21 lines 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 7 chunks +101 lines, -18 lines 0 comments Download
M content/browser/service_worker/service_worker_handle_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_job_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_navigation_handle_core.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_provider_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 6 chunks +25 lines, -4 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 9 chunks +62 lines, -8 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 7 chunks +48 lines, -10 lines 0 comments Download
M content/browser/service_worker/service_worker_registration_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_request_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +5 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_storage_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +9 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_test_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +38 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +25 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_version_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M content/child/service_worker/service_worker_dispatcher_unittest.cc View 1 2 3 4 5 6 7 6 chunks +20 lines, -14 lines 0 comments Download
M content/child/service_worker/service_worker_network_provider.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/child/service_worker/service_worker_network_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +13 lines, -5 lines 0 comments Download
M content/child/service_worker/service_worker_provider_context.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +19 lines, -5 lines 0 comments Download
M content/child/service_worker/service_worker_provider_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +9 lines, -7 lines 0 comments Download
M content/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -0 lines 0 comments Download
M content/common/service_worker/service_worker.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +11 lines, -4 lines 0 comments Download
M content/common/service_worker/service_worker_provider.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +5 lines, -1 line 0 comments Download
M content/common/service_worker/service_worker_provider_host_info.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +18 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_provider_host_info.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +18 lines, -1 line 0 comments Download
A content/common/service_worker/service_worker_provider_interfaces.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +27 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_provider_struct_traits.h View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_provider_struct_traits.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 96 (72 generated)
shimazu
Could you take a look? // I need updating this patch since several tests are ...
3 years, 9 months ago (2017-03-27 09:36:38 UTC) #10
falken
Overall this seems to make sense but it'd be easier to understand with more high ...
3 years, 9 months ago (2017-03-28 06:29:43 UTC) #11
shimazu
Thanks for your comments. Updated this patch. PTAnL. https://codereview.chromium.org/2653493009/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/2653493009/diff/120001/content/browser/service_worker/service_worker_provider_host.cc#newcode62 content/browser/service_worker/service_worker_provider_host.cc:62: ResourceContext* ...
3 years, 7 months ago (2017-05-08 08:34:29 UTC) #28
shimazu
On 2017/05/08 08:34:29, shimazu wrote: > Thanks for your comments. > Updated this patch. PTAnL. ...
3 years, 7 months ago (2017-05-09 01:14:15 UTC) #31
shimazu
Sorry for very long delay. I've fixed this patch and also another patch for browser-side ...
3 years, 7 months ago (2017-05-17 05:55:20 UTC) #45
shimazu
A couple of tests failed when BrowserSideNavigation is enabled. Fixed on ps#14.
3 years, 7 months ago (2017-05-17 07:53:11 UTC) #48
falken
This looks pretty good but I haven't been able to read it all. Do you ...
3 years, 7 months ago (2017-05-18 04:13:10 UTC) #51
shimazu
Thanks for your comments. Uploaded ps#18. PTAnL. https://codereview.chromium.org/2653493009/diff/280001/content/browser/service_worker/service_worker_provider_host.h File content/browser/service_worker/service_worker_provider_host.h (left): https://codereview.chromium.org/2653493009/diff/280001/content/browser/service_worker/service_worker_provider_host.h#oldcode397 content/browser/service_worker/service_worker_provider_host.h:397: const bool ...
3 years, 7 months ago (2017-05-19 08:31:07 UTC) #52
falken
OK I think this lgtm. Thanks for the massive updates to the unit tests. I'm ...
3 years, 7 months ago (2017-05-22 08:28:13 UTC) #57
shimazu
kinuko@: PTAL at BUILD.gn and roughly overall. tsepez@: PTAL at mojo related stuff (.mojom and ...
3 years, 7 months ago (2017-05-23 06:29:34 UTC) #63
shimazu
> I'm wondering if we should wait until the branch to land this. WDYT? Yeah, ...
3 years, 7 months ago (2017-05-23 06:34:10 UTC) #66
falken
https://codereview.chromium.org/2653493009/diff/360001/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc File content/browser/service_worker/service_worker_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/2653493009/diff/360001/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc#newcode561 content/browser/service_worker/service_worker_dispatcher_host_unittest.cc:561: const int kProviderId = (IsBrowserSideNavigationEnabled() ? -2 : 1001); ...
3 years, 7 months ago (2017-05-23 08:31:49 UTC) #67
kinuko
lgtm, I have some documentation-comments on mojom file though. (falken@ might have different opinion?) https://codereview.chromium.org/2653493009/diff/400001/content/browser/service_worker/service_worker_provider_host.h ...
3 years, 7 months ago (2017-05-23 12:57:21 UTC) #70
Tom Sepez
lgtm
3 years, 7 months ago (2017-05-23 16:40:21 UTC) #71
falken
https://codereview.chromium.org/2653493009/diff/400001/content/browser/service_worker/service_worker_provider_host.h File content/browser/service_worker/service_worker_provider_host.h (right): https://codereview.chromium.org/2653493009/diff/400001/content/browser/service_worker/service_worker_provider_host.h#newcode58 content/browser/service_worker/service_worker_provider_host.h:58: // resource loads made directly by the service worker. ...
3 years, 6 months ago (2017-05-29 08:47:29 UTC) #72
shimazu
Thanks, updated the comments (ps#23). falken: Could you take another look just in case? https://codereview.chromium.org/2653493009/diff/400001/content/browser/service_worker/service_worker_provider_host.h ...
3 years, 6 months ago (2017-05-30 03:50:07 UTC) #79
falken
LGTM % nits https://codereview.chromium.org/2653493009/diff/440001/content/browser/service_worker/service_worker_provider_host.h File content/browser/service_worker/service_worker_provider_host.h (right): https://codereview.chromium.org/2653493009/diff/440001/content/browser/service_worker/service_worker_provider_host.h#newcode60 content/browser/service_worker/service_worker_provider_host.h:60: // This instance is created when ...
3 years, 6 months ago (2017-05-30 04:12:32 UTC) #82
shimazu
https://codereview.chromium.org/2653493009/diff/460001/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc File content/browser/service_worker/service_worker_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/2653493009/diff/460001/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc#newcode558 content/browser/service_worker/service_worker_dispatcher_host_unittest.cc:558: const int kProviderId = (IsBrowserSideNavigationEnabled() ? -2 : 1001); ...
3 years, 6 months ago (2017-05-30 07:24:35 UTC) #83
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2653493009/480001
3 years, 6 months ago (2017-05-30 07:25:08 UTC) #86
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/467143)
3 years, 6 months ago (2017-05-30 09:36:16 UTC) #88
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2653493009/500001
3 years, 6 months ago (2017-05-31 02:53:22 UTC) #91
commit-bot: I haz the power
Committed patchset #25 (id:500001) as https://chromium.googlesource.com/chromium/src/+/4223216d2fa2a111c5e0636017bb6766682adda9
3 years, 6 months ago (2017-05-31 05:16:27 UTC) #94
falken
On 2017/05/31 05:16:27, commit-bot: I haz the power wrote: > Committed patchset #25 (id:500001) as ...
3 years, 6 months ago (2017-06-01 07:56:41 UTC) #95
shimazu
3 years, 6 months ago (2017-06-01 08:18:54 UTC) #96
Message was sent while issue was closed.
Oops... I missed them. 
I created another CL to fix them:
https://chromium-review.googlesource.com/c/520445/

https://codereview.chromium.org/2653493009/diff/440001/content/browser/servic...
File content/browser/service_worker/service_worker_provider_host.h (right):

https://codereview.chromium.org/2653493009/diff/440001/content/browser/servic...
content/browser/service_worker/service_worker_provider_host.h:60: // This
instance is created when navigation is started and
On 2017/05/30 04:12:31, falken wrote:
> s/This instance/A ServiceWorkerProviderHost instance/
> 
> I don't think "navigation is started" is correct: SWPH is also created when
you
> start a SW.

Addressed this at https://chromium-review.googlesource.com/520445

https://codereview.chromium.org/2653493009/diff/440001/content/browser/servic...
content/browser/service_worker/service_worker_provider_host.h:61: //
ServiceWorkerNetworkProvider is create on the renderer process. Mojo's
On 2017/05/30 04:12:32, falken wrote:
> s/create/created

Addressed this at https://chromium-review.googlesource.com/520445

https://codereview.chromium.org/2653493009/diff/440001/content/browser/servic...
content/browser/service_worker/service_worker_provider_host.h:64: // If
PlzNavigate is turned on, this instance is pre-created on the browser
On 2017/05/30 04:12:32, falken wrote:
> s/this instance/an instance

Addressed this at https://chromium-review.googlesource.com/520445

https://codereview.chromium.org/2653493009/diff/440001/content/browser/servic...
content/browser/service_worker/service_worker_provider_host.h:66: // navigation
is possible to be initiated on the browser side. In that case,
On 2017/05/30 04:12:32, falken wrote:
> s/is possible to be/is/

Addressed this at https://chromium-review.googlesource.com/520445

https://codereview.chromium.org/2653493009/diff/440001/content/browser/servic...
content/browser/service_worker/service_worker_provider_host.h:68: //
ServiceWorkerNetworkProvider is created on the renderer.
On 2017/05/30 04:12:31, falken wrote:
> Thanks for the comment!

Your welcome!:)

https://codereview.chromium.org/2653493009/diff/460001/content/common/service...
File content/common/service_worker/service_worker.mojom (right):

https://codereview.chromium.org/2653493009/diff/460001/content/common/service...
content/common/service_worker/service_worker.mojom:14: // service workers are
starting up.
On 2017/05/30 04:12:32, falken wrote:
> I guess this violates our new policy of not mentioning impl specifically in
the
> interface comments.
> 
> But the comment already existed before this CL no need to block on it. We can
> work this later.

Addressed this at https://chromium-review.googlesource.com/520445

Powered by Google App Engine
This is Rietveld 408576698