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

Issue 139923005: Implement ServiceWorkerVersion::SendMessage() (for dispatching events etc) (Closed)

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

Description

Implement ServiceWorkerVersion::SendMessage() As a preparation to implement DispatchInstallEvent(), this implements following two methods: - SendMessage() - SendMessageAndRegisterCallback() Unlike my previous patches, this supports: - Sending messages without explicitly starting the worker - Sending multiple messages concurrently - Receiving a response for each message Now each message can be sent with a unique 'request_id', which can be used to send back a response to a particular message. BUG=313530 TEST=ServiceWorkerVersionTest.\* R=alecflett@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=248889

Patch Set 1 #

Patch Set 2 : #

Total comments: 10

Patch Set 3 : addressed comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+358 lines, -55 lines) Patch
M content/browser/service_worker/embedded_worker_instance.h View 3 chunks +8 lines, -3 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.cc View 2 chunks +7 lines, -3 lines 0 comments Download
M content/browser/service_worker/embedded_worker_registry.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_registry.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/service_worker/embedded_worker_test_helper.h View 3 chunks +3 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_test_helper.cc View 4 chunks +5 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_test_utils.h View 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.h View 5 chunks +29 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 5 chunks +98 lines, -7 lines 1 comment Download
M content/browser/service_worker/service_worker_version_unittest.cc View 1 2 4 chunks +167 lines, -25 lines 0 comments Download
M content/common/service_worker/embedded_worker_messages.h View 2 chunks +6 lines, -2 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.h View 2 chunks +2 lines, -1 line 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M content/renderer/service_worker/service_worker_script_context.h View 2 chunks +5 lines, -2 lines 0 comments Download
M content/renderer/service_worker/service_worker_script_context.cc View 1 2 1 chunk +9 lines, -3 lines 1 comment Download

Messages

Total messages: 11 (0 generated)
kinuko
This patch tries to support much more generic messaging than my previous patches. PTL
6 years, 10 months ago (2014-01-31 10:32:14 UTC) #1
alecflett
overall I like this - a few nits and one issue with requests. https://codereview.chromium.org/139923005/diff/40001/content/browser/service_worker/service_worker_version.cc File ...
6 years, 10 months ago (2014-02-04 20:53:24 UTC) #2
alecflett
On 2014/02/04 20:53:24, alecflett wrote: > I'm honestly not quite sure what the right thing ...
6 years, 10 months ago (2014-02-04 21:09:34 UTC) #3
kinuko
https://codereview.chromium.org/139923005/diff/40001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/139923005/diff/40001/content/browser/service_worker/service_worker_version.cc#newcode219 content/browser/service_worker/service_worker_version.cc:219: message_callbacks_.Remove(request_id); On 2014/02/04 20:53:24, alecflett wrote: > This is ...
6 years, 10 months ago (2014-02-04 22:17:12 UTC) #4
kinuko
Updated, or added response. https://codereview.chromium.org/139923005/diff/40001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/139923005/diff/40001/content/browser/service_worker/service_worker_version.cc#newcode205 content/browser/service_worker/service_worker_version.cc:205: // Let all message callbacks ...
6 years, 10 months ago (2014-02-04 22:50:24 UTC) #5
alecflett
lgtm
6 years, 10 months ago (2014-02-04 23:16:44 UTC) #6
jsbell
https://codereview.chromium.org/139923005/diff/70001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/139923005/diff/70001/content/browser/service_worker/service_worker_version.cc#newcode176 content/browser/service_worker/service_worker_version.cc:176: -1, ServiceWorkerMsg_FetchEvent(request)) == SERVICE_WORKER_OK; Sorry for the late drive-by, ...
6 years, 10 months ago (2014-02-04 23:29:03 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kinuko@chromium.org/139923005/70001
6 years, 10 months ago (2014-02-04 23:30:33 UTC) #8
kinuko
On 2014/02/04 23:29:03, jsbell wrote: > https://codereview.chromium.org/139923005/diff/70001/content/browser/service_worker/service_worker_version.cc > File content/browser/service_worker/service_worker_version.cc (right): > > https://codereview.chromium.org/139923005/diff/70001/content/browser/service_worker/service_worker_version.cc#newcode176 > ...
6 years, 10 months ago (2014-02-05 00:39:20 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kinuko@chromium.org/139923005/70001
6 years, 10 months ago (2014-02-05 01:35:41 UTC) #10
kinuko
6 years, 10 months ago (2014-02-05 06:57:42 UTC) #11
Message was sent while issue was closed.
Committed patchset #3 manually as r248889 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698