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

Issue 189253002: Implement ServiceWorker::postMessage() [Chromium] (Closed)

Created:
6 years, 9 months ago by jsbell
Modified:
6 years, 9 months ago
CC:
chromium-reviews, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, nhiroki, joi+watch-content_chromium.org, darin-cc_chromium.org, horo+watch_chromium.org, kinuko+watch, alecflett+watch_chromium.org
Visibility:
Public.

Description

Implement ServiceWorker::postMessage() This allows the registering page, or pages loaded via the worker, to send arbitrary messages to the worker script. BUG=350103 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=258727

Patch Set 1 #

Patch Set 2 : Handle routing ids for ports #

Patch Set 3 : Tackle various TODOs #

Patch Set 4 : Rebased #

Patch Set 5 : Test fix #

Patch Set 6 : Reup #

Total comments: 17

Patch Set 7 : Review feedback #

Total comments: 11

Patch Set 8 : Review feedback #

Patch Set 9 : Rebase fixes #

Total comments: 9

Patch Set 10 : Review feedback #

Total comments: 3

Patch Set 11 : git-cl format and review feedback #

Total comments: 4

Patch Set 12 : Review feedback #

Patch Set 13 : Rename message handler per review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -33 lines) Patch
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -6 lines 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host.h View 1 2 3 4 5 6 7 3 chunks +18 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 4 chunks +58 lines, -6 lines 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host_unittest.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_storage.h View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_storage.cc View 1 2 3 4 5 6 7 8 1 chunk +18 lines, -0 lines 0 comments Download
M content/child/service_worker/service_worker_dispatcher.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/child/service_worker/web_service_worker_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -2 lines 0 comments Download
M content/child/service_worker/web_service_worker_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +18 lines, -0 lines 0 comments Download
M content/child/webmessageportchannel_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -0 lines 0 comments Download
M content/child/webmessageportchannel_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +20 lines, -14 lines 0 comments Download
M content/common/service_worker/service_worker_messages.h View 1 2 3 4 5 6 2 chunks +12 lines, -0 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.h View 1 2 3 4 5 6 1 chunk +3 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 9 10 11 12 3 chunks +9 lines, -1 line 0 comments Download
M content/renderer/service_worker/service_worker_script_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +19 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
jsbell
This is ready for an initial look. Layout test over on the Blink side demonstrates ...
6 years, 9 months ago (2014-03-10 21:52:05 UTC) #1
michaeln
can u reup this patch?
6 years, 9 months ago (2014-03-11 00:59:35 UTC) #2
jsbell
On 2014/03/11 00:59:35, michaeln wrote: > can u reup this patch? Re-upped.
6 years, 9 months ago (2014-03-11 17:40:02 UTC) #3
jsbell
https://codereview.chromium.org/189253002/diff/110001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/189253002/diff/110001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode201 content/browser/service_worker/service_worker_dispatcher_host.cc:201: // TODO(jsbell): Need version_id passed along to disambiguate? This ...
6 years, 9 months ago (2014-03-11 22:01:49 UTC) #4
michaeln
looking pretty good https://codereview.chromium.org/189253002/diff/110001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/189253002/diff/110001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode168 content/browser/service_worker/service_worker_dispatcher_host.cc:168: base::string16 message, const ref here https://codereview.chromium.org/189253002/diff/110001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode169 ...
6 years, 9 months ago (2014-03-11 23:17:33 UTC) #5
michaeln
> TODO(jsbell): Need version_id passed along to disambiguate? This is a spec question really.
6 years, 9 months ago (2014-03-11 23:19:19 UTC) #6
kinuko
Looking good to me too https://codereview.chromium.org/189253002/diff/110001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/189253002/diff/110001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode201 content/browser/service_worker/service_worker_dispatcher_host.cc:201: // TODO(jsbell): Need version_id ...
6 years, 9 months ago (2014-03-12 08:19:04 UTC) #7
jsbell
https://codereview.chromium.org/189253002/diff/110001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/189253002/diff/110001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode168 content/browser/service_worker/service_worker_dispatcher_host.cc:168: base::string16 message, On 2014/03/11 23:17:34, michaeln wrote: > const ...
6 years, 9 months ago (2014-03-12 18:16:16 UTC) #8
michaeln
couple minor things + the raw ptr question https://codereview.chromium.org/189253002/diff/130001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/189253002/diff/130001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode189 content/browser/service_worker/service_worker_dispatcher_host.cc:189: if ...
6 years, 9 months ago (2014-03-12 23:38:47 UTC) #9
jsbell
https://codereview.chromium.org/189253002/diff/130001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/189253002/diff/130001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode181 content/browser/service_worker/service_worker_dispatcher_host.cc:181: static void NoOpStatusCallback(ServiceWorkerStatusCode status) {} BTW, this is necessary ...
6 years, 9 months ago (2014-03-13 17:53:26 UTC) #10
michaeln
https://codereview.chromium.org/189253002/diff/130001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/189253002/diff/130001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode181 content/browser/service_worker/service_worker_dispatcher_host.cc:181: static void NoOpStatusCallback(ServiceWorkerStatusCode status) {} > I could rework ...
6 years, 9 months ago (2014-03-13 21:16:41 UTC) #11
jsbell
https://codereview.chromium.org/189253002/diff/130001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/189253002/diff/130001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode202 content/browser/service_worker/service_worker_dispatcher_host.cc:202: result->active_version()->SendMessage( On 2014/03/13 21:16:42, michaeln wrote: > > Making ...
6 years, 9 months ago (2014-03-14 18:11:44 UTC) #12
jsbell
marja@ - could you please take a look at the "message port" voodoo here and ...
6 years, 9 months ago (2014-03-14 18:13:14 UTC) #13
marja
I left some comments. Could you also add a test to make sure that passing ...
6 years, 9 months ago (2014-03-17 09:15:01 UTC) #14
marja
(Oops, I just noticed you have tests in the Blink CL, lemme have a look ...
6 years, 9 months ago (2014-03-17 09:16:24 UTC) #15
jsbell
https://codereview.chromium.org/189253002/diff/170001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/189253002/diff/170001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode191 content/browser/service_worker/service_worker_dispatcher_host.cc:191: static void NoOpStatusCallback(ServiceWorkerStatusCode status) {} On 2014/03/17 09:15:02, marja ...
6 years, 9 months ago (2014-03-17 16:49:05 UTC) #16
marja
messageport parts lgtm; you still need a content/ owner. https://codereview.chromium.org/189253002/diff/170001/content/child/webmessageportchannel_impl.cc File content/child/webmessageportchannel_impl.cc (right): https://codereview.chromium.org/189253002/diff/170001/content/child/webmessageportchannel_impl.cc#newcode67 content/child/webmessageportchannel_impl.cc:67: ...
6 years, 9 months ago (2014-03-17 17:04:05 UTC) #17
michaeln
lgtm https://codereview.chromium.org/189253002/diff/190001/content/renderer/service_worker/service_worker_script_context.cc File content/renderer/service_worker/service_worker_script_context.cc (right): https://codereview.chromium.org/189253002/diff/190001/content/renderer/service_worker/service_worker_script_context.cc#newcode73 content/renderer/service_worker/service_worker_script_context.cc:73: nit: blank line not needed Also i was ...
6 years, 9 months ago (2014-03-17 19:14:02 UTC) #18
michaeln
https://codereview.chromium.org/189253002/diff/190001/content/renderer/service_worker/service_worker_script_context.cc File content/renderer/service_worker/service_worker_script_context.cc (right): https://codereview.chromium.org/189253002/diff/190001/content/renderer/service_worker/service_worker_script_context.cc#newcode73 content/renderer/service_worker/service_worker_script_context.cc:73: > // There is no corresponding message sent back ...
6 years, 9 months ago (2014-03-17 19:36:45 UTC) #19
jsbell
https://codereview.chromium.org/189253002/diff/190001/content/renderer/service_worker/service_worker_script_context.cc File content/renderer/service_worker/service_worker_script_context.cc (right): https://codereview.chromium.org/189253002/diff/190001/content/renderer/service_worker/service_worker_script_context.cc#newcode73 content/renderer/service_worker/service_worker_script_context.cc:73: On 2014/03/17 19:36:46, michaeln wrote: > > // There ...
6 years, 9 months ago (2014-03-18 17:20:13 UTC) #20
jsbell
jam@ - could you please review for the generic content/ bits?
6 years, 9 months ago (2014-03-19 00:10:02 UTC) #21
jam
lgtm https://codereview.chromium.org/189253002/diff/210001/content/child/service_worker/web_service_worker_impl.cc File content/child/service_worker/web_service_worker_impl.cc (right): https://codereview.chromium.org/189253002/diff/210001/content/child/service_worker/web_service_worker_impl.cc#newcode10 content/child/service_worker/web_service_worker_impl.cc:10: #include "ipc/ipc_message.h" nit: don't need this, you get ...
6 years, 9 months ago (2014-03-19 21:08:48 UTC) #22
jsbell
Thanks. Now waiting on the blink side to land + roll. https://codereview.chromium.org/189253002/diff/210001/content/child/service_worker/web_service_worker_impl.cc File content/child/service_worker/web_service_worker_impl.cc (right): ...
6 years, 9 months ago (2014-03-19 23:52:39 UTC) #23
jsbell
The CQ bit was checked by jsbell@chromium.org
6 years, 9 months ago (2014-03-21 16:24:18 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/189253002/230001
6 years, 9 months ago (2014-03-21 16:24:21 UTC) #25
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-21 16:48:30 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_compile_dbg
6 years, 9 months ago (2014-03-21 16:48:31 UTC) #27
jsbell
tsepez@ - can you review the IPC message additions?
6 years, 9 months ago (2014-03-21 16:56:42 UTC) #28
Tom Sepez
On 2014/03/21 16:56:42, jsbell wrote: > tsepez@ - can you review the IPC message additions? ...
6 years, 9 months ago (2014-03-21 17:47:49 UTC) #29
jsbell
On 2014/03/21 17:47:49, Tom Sepez wrote: > On 2014/03/21 16:56:42, jsbell wrote: > > tsepez@ ...
6 years, 9 months ago (2014-03-21 18:38:43 UTC) #30
jsbell
The CQ bit was checked by jsbell@chromium.org
6 years, 9 months ago (2014-03-21 18:52:53 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/189253002/250001
6 years, 9 months ago (2014-03-21 18:52:58 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-21 18:54:49 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_clang_dbg
6 years, 9 months ago (2014-03-21 18:54:50 UTC) #34
jsbell
The CQ bit was checked by jsbell@chromium.org
6 years, 9 months ago (2014-03-21 21:22:41 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/189253002/250001
6 years, 9 months ago (2014-03-21 21:23:26 UTC) #36
commit-bot: I haz the power
6 years, 9 months ago (2014-03-22 00:45:41 UTC) #37
Message was sent while issue was closed.
Change committed as 258727

Powered by Google App Engine
This is Rietveld 408576698