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

Issue 1264333002: First step to refactor ServiceWorkerVersion to make event dispatching more modular. (Closed)

Created:
5 years, 4 months ago by Marijn Kruisselbrink
Modified:
4 years, 11 months ago
CC:
blink-worker-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, horo+watch_chromium.org, jam, jsbell+serviceworker_chromium.org, kinuko+serviceworker, kinuko+watch, michaeln, 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

First step to refactor ServiceWorkerVersion to make event dispatching more modular. As described in https://docs.google.com/document/d/1k3xQuV2cQgygJXMpD4Jf77H88040Vcnixz-XW5o6GMM/edit?pli=1#heading=h.ysf7bzmgf12b, this CL adds API to allow other code to inform SWVersion about events in progress, and let SWVersion deal with timeouts and service worker lifetime management in relation to these events. On top of that this CL also adds a more generic mechanism for events that use mojo services to connect to these mojo services (and have connections to those services automatically close when the worker is stopped). Finally this CL updates the navigator.connect call to use this new way of dispatching events. Follow up CLs will update other mojo based events, and will introduce the infrastructure to also move IPC based events out of SWVersion. BUG=570820 Committed: https://crrev.com/24f20a4f6da8507e47ace8dd6a43e698d241e647 Cr-Commit-Position: refs/heads/master@{#368353}

Patch Set 1 : #

Patch Set 2 : rebase #

Patch Set 3 : small fixes #

Patch Set 4 : rebase #

Patch Set 5 : try to fix windows build #

Patch Set 6 : small improvements #

Patch Set 7 : rebase #

Patch Set 8 : rebase #

Total comments: 6

Patch Set 9 : rebase #

Patch Set 10 : nit #

Patch Set 11 : add EventType argument to StartRequest #

Total comments: 6

Patch Set 12 : nits #

Total comments: 2

Patch Set 13 : rockot nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+575 lines, -175 lines) Patch
M content/browser/navigator_connect/navigator_connect_context_impl.h View 1 2 3 4 3 chunks +21 lines, -5 lines 0 comments Download
M content/browser/navigator_connect/navigator_connect_context_impl.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +62 lines, -18 lines 0 comments Download
M content/browser/service_worker/embedded_worker_test_helper.h View 1 2 3 4 5 6 7 8 5 chunks +18 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 5 chunks +52 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_metrics.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_metrics.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 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 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_provider_host.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_test_utils.h View 1 chunk +5 lines, -3 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 12 14 chunks +121 lines, -28 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 12 23 chunks +83 lines, -102 lines 0 comments Download
M content/browser/service_worker/service_worker_version_unittest.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +169 lines, -0 lines 0 comments Download
M content/public/test/mock_render_process_host.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -0 lines 0 comments Download
M content/public/test/mock_render_process_host.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +12 lines, -12 lines 0 comments Download

Messages

Total messages: 39 (20 generated)
Marijn Kruisselbrink
nhiroki: PTAL rockot: to make sure the mojo specific bits of this CL make sense
5 years ago (2015-12-17 22:40:03 UTC) #14
nhiroki
I came back from vacation. Sorry, I couldn't take enough time to read this patch ...
4 years, 11 months ago (2016-01-05 09:33:24 UTC) #15
Marijn Kruisselbrink
Don't worry about the delay, I was on vacation myself too. https://codereview.chromium.org/1264333002/diff/300001/content/browser/navigator_connect/navigator_connect_context_impl.cc File content/browser/navigator_connect/navigator_connect_context_impl.cc (right): ...
4 years, 11 months ago (2016-01-05 23:23:16 UTC) #16
nhiroki
Looks good. Let me discuss UMA stats just a bit more... https://codereview.chromium.org/1264333002/diff/300001/content/browser/service_worker/service_worker_version.h File content/browser/service_worker/service_worker_version.h (right): ...
4 years, 11 months ago (2016-01-06 10:13:57 UTC) #17
Marijn Kruisselbrink
https://codereview.chromium.org/1264333002/diff/300001/content/browser/service_worker/service_worker_version.h File content/browser/service_worker/service_worker_version.h (right): https://codereview.chromium.org/1264333002/diff/300001/content/browser/service_worker/service_worker_version.h#newcode403 content/browser/service_worker/service_worker_version.h:403: REQUEST_CUSTOM, On 2016/01/06 at 10:13:57, nhiroki wrote: > Thank ...
4 years, 11 months ago (2016-01-07 00:59:08 UTC) #18
nhiroki
LGTM. Thank you! https://codereview.chromium.org/1264333002/diff/360001/content/browser/service_worker/embedded_worker_test_helper.cc File content/browser/service_worker/embedded_worker_test_helper.cc (right): https://codereview.chromium.org/1264333002/diff/360001/content/browser/service_worker/embedded_worker_test_helper.cc#newcode55 content/browser/service_worker/embedded_worker_test_helper.cc:55: static void Create(base::WeakPtr<EmbeddedWorkerTestHelper> helper, nit: const ...
4 years, 11 months ago (2016-01-07 05:06:09 UTC) #19
Marijn Kruisselbrink
rockot: could you make sure the mojo code (particularly in service_worker_version and embedded_worker_test_helper) doesn't do ...
4 years, 11 months ago (2016-01-07 18:30:39 UTC) #21
Mark P
https://codereview.chromium.org/1264333002/diff/380001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1264333002/diff/380001/tools/metrics/histograms/histograms.xml#newcode43717 tools/metrics/histograms/histograms.xml:43717: + enum="ServiceWorkerMetrics.EventType"> It looks like enums are equivalent. Is ...
4 years, 11 months ago (2016-01-07 19:47:53 UTC) #22
Marijn Kruisselbrink
https://codereview.chromium.org/1264333002/diff/380001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1264333002/diff/380001/tools/metrics/histograms/histograms.xml#newcode43717 tools/metrics/histograms/histograms.xml:43717: + enum="ServiceWorkerMetrics.EventType"> On 2016/01/07 at 19:47:53, Mark P wrote: ...
4 years, 11 months ago (2016-01-07 20:33:44 UTC) #23
Mark P
in those cases, histograms.xml lgtm
4 years, 11 months ago (2016-01-07 20:35:02 UTC) #24
Ken Rockot(use gerrit already)
I don't see anything fundamentally wrong about what you're doing, but I also don't quite ...
4 years, 11 months ago (2016-01-07 20:36:48 UTC) #26
Marijn Kruisselbrink
On 2016/01/07 at 20:36:48, rockot wrote: > I don't see anything fundamentally wrong about what ...
4 years, 11 months ago (2016-01-07 21:33:06 UTC) #28
Marijn Kruisselbrink
+phajdan.jr for content/public/test OWNERS
4 years, 11 months ago (2016-01-07 21:39:31 UTC) #30
Ken Rockot(use gerrit already)
On 2016/01/07 at 21:33:06, mek wrote: > On 2016/01/07 at 20:36:48, rockot wrote: > > ...
4 years, 11 months ago (2016-01-07 22:27:28 UTC) #31
Marijn Kruisselbrink
On 2016/01/07 at 22:27:28, rockot wrote: > On 2016/01/07 at 21:33:06, mek wrote: > > ...
4 years, 11 months ago (2016-01-08 01:32:52 UTC) #32
Paweł Hajdan Jr.
content/public/test LGTM
4 years, 11 months ago (2016-01-08 16:53:22 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1264333002/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1264333002/400001
4 years, 11 months ago (2016-01-08 16:54:15 UTC) #36
commit-bot: I haz the power
Committed patchset #13 (id:400001)
4 years, 11 months ago (2016-01-08 16:59:25 UTC) #37
commit-bot: I haz the power
4 years, 11 months ago (2016-01-08 17:00:29 UTC) #39
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/24f20a4f6da8507e47ace8dd6a43e698d241e647
Cr-Commit-Position: refs/heads/master@{#368353}

Powered by Google App Engine
This is Rietveld 408576698