|
|
Chromium Code Reviews|
Created:
3 years, 8 months ago by leonhsl(Using Gerrit) Modified:
3 years, 8 months ago CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, shimazu+serviceworker_chromium.org, serviceworker-reviews, jam, nhiroki, kinuko+serviceworker, horo+watch_chromium.org, darin-cc_chromium.org, kinuko+watch, tzik, blink-worker-reviews_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
Description[ServiceWorker] Remove useless ServiceWorkerVersion::DispatchSimpleEvent().
As all simple events have been converted into mojo interface
ServiceWorkerEventDispatcher, now there are no codes using
ServiceWorkerVersion::DispatchSimpleEvent(), so this CL removes it
completely.
No other code behavior change.
BUG=629701
TBR=tsepez@chromium.org
for adding comment into service_worker_event_dispatcher.mojom
Review-Url: https://codereview.chromium.org/2779093003
Cr-Commit-Position: refs/heads/master@{#460744}
Committed: https://chromium.googlesource.com/chromium/src/+/29783ad5a5cbc0569d4a5578c82feca23223a621
Patch Set 1 #
Total comments: 2
Patch Set 2 : Add comments about 'simple event' #
Total comments: 2
Patch Set 3 : Refine comment #
Messages
Total messages: 34 (21 generated)
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...)
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
leon.han@intel.com changed reviewers: + falken@chromium.org, shimazu@chromium.org
A clean up CL, PTAL, Thanks.
lgtm, Thanks!
lgtm. It's a bit awkward that ServiceWorkerVersion still has a concept of
"simple event" (from CreateSimpleEventCallback and SimpleEventCallback) even
though there is no mention of dispatching simple events or what a simple event
is.
Ideally the mojom callbacks for (blink.mojom.ServiceWorkerEventStatus status,
mojo.common.mojom.Time dispatch_event_time);
in service_worker_event_dispatcher.mojom would have some documentation or
typename to make clear that this is the "simple event" being talked about in
ServiceWorkerVersion.
https://codereview.chromium.org/2779093003/diff/1/content/browser/service_wor...
File content/browser/service_worker/service_worker_version_unittest.cc (left):
https://codereview.chromium.org/2779093003/diff/1/content/browser/service_wor...
content/browser/service_worker/service_worker_version_unittest.cc:1560:
TEST_F(ServiceWorkerVersionTest, DispatchSimpleEvent_Completed) {
I assume this test coverage is elsewhere for the Mojo-based events?
Yeah I agree we'd better make some connections between events in .mojom file and the 'simple event' notion in ServiceWorkerVersion. I checked around and seems no good way to put something like typename into .mojom file, so can we just add a comment for interface ServiceWorkerEventDispatcher like: ' Those events expecting such response (blink.mojom.ServiceWorkerEventStatus status, mojo.common.mojom.Time dispatch_event_time) are dispatched as 'simple event'. See ServiceWorkerVersion for implementation details. ' https://codereview.chromium.org/2779093003/diff/1/content/browser/service_wor... File content/browser/service_worker/service_worker_version_unittest.cc (left): https://codereview.chromium.org/2779093003/diff/1/content/browser/service_wor... content/browser/service_worker/service_worker_version_unittest.cc:1560: TEST_F(ServiceWorkerVersionTest, DispatchSimpleEvent_Completed) { On 2017/03/30 03:51:39, falken wrote: > I assume this test coverage is elsewhere for the Mojo-based events? This unit test is for testing SWVersion::DispatchSimpleEvent<>, the goal is to verify that the mechanism composed by {template DispatchSimpleEvent<>, template RegisterSimpleRequest<>, function OnSimpleEventResponse()} can work correctly, now we're removing this mechanism, so I think we can remove all its unit tests together. As for the equivalent test for Mojo-based events, I think service_worker_browsertest.cc is covering some cases, activate and fetch event etc. I think they're already verifying that the Mojo-based event dispatch mechanism can work correctly.
On 2017/03/30 07:13:10, leonhsl wrote: > Yeah I agree we'd better make some connections between events in .mojom file and > the 'simple event' notion in ServiceWorkerVersion. I checked around and seems no > good way to put something like typename into .mojom file, so can we just add a > comment for interface ServiceWorkerEventDispatcher like: > ' > Those events expecting such response (blink.mojom.ServiceWorkerEventStatus > status, mojo.common.mojom.Time dispatch_event_time) are dispatched as 'simple > event'. See ServiceWorkerVersion for implementation details. > ' SGTM. We should additionally a comment in SWVersion in the other direction. > > https://codereview.chromium.org/2779093003/diff/1/content/browser/service_wor... > File content/browser/service_worker/service_worker_version_unittest.cc (left): > > https://codereview.chromium.org/2779093003/diff/1/content/browser/service_wor... > content/browser/service_worker/service_worker_version_unittest.cc:1560: > TEST_F(ServiceWorkerVersionTest, DispatchSimpleEvent_Completed) { > On 2017/03/30 03:51:39, falken wrote: > > I assume this test coverage is elsewhere for the Mojo-based events? > > This unit test is for testing SWVersion::DispatchSimpleEvent<>, the goal is to > verify that the mechanism composed by {template DispatchSimpleEvent<>, template > RegisterSimpleRequest<>, function OnSimpleEventResponse()} can work correctly, > now we're removing this mechanism, so I think we can remove all its unit tests > together. > > As for the equivalent test for Mojo-based events, I think > service_worker_browsertest.cc is covering some cases, activate and fetch event > etc. I think they're already verifying that the Mojo-based event dispatch > mechanism can work correctly. Sure, OK.
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Uploaded ps#2, PTAnL, Thanks.
thanks, stil lgtm with a comment tweak request https://codereview.chromium.org/2779093003/diff/20001/content/common/service_... File content/common/service_worker/service_worker_event_dispatcher.mojom (right): https://codereview.chromium.org/2779093003/diff/20001/content/common/service_... content/common/service_worker/service_worker_event_dispatcher.mojom:59: // as 'simple event'. See ServiceWorkerVersion for implementation details. I would rather phrase this as "... are considered 'simple events'. ServiceWorkerVersion::CreateSimpleEventCallback can be used to create the callback for these". Otherwise it sounds like there is a material difference between how to dispatch a simple event and non-simple event.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== [ServiceWorker] Remove useless ServiceWorkerVersion::DispatchSimpleEvent(). As all simple events have been converted into mojo interface ServiceWorkerEventDispatcher, now there are no codes using ServiceWorkerVersion::DispatchSimpleEvent(), so this CL removes it completely. No other code behavior change. BUG=629701 ========== to ========== [ServiceWorker] Remove useless ServiceWorkerVersion::DispatchSimpleEvent(). As all simple events have been converted into mojo interface ServiceWorkerEventDispatcher, now there are no codes using ServiceWorkerVersion::DispatchSimpleEvent(), so this CL removes it completely. No other code behavior change. BUG=629701 TBR=tsepez@chromium.org for adding comment into service_worker_event_dispatcher.mojom ==========
Thanks! Let me TBR Tom for adding comment into service_worker_event_dispatcher.mojom, send to CQ now. https://codereview.chromium.org/2779093003/diff/20001/content/common/service_... File content/common/service_worker/service_worker_event_dispatcher.mojom (right): https://codereview.chromium.org/2779093003/diff/20001/content/common/service_... content/common/service_worker/service_worker_event_dispatcher.mojom:59: // as 'simple event'. See ServiceWorkerVersion for implementation details. On 2017/03/30 08:21:29, falken wrote: > I would rather phrase this as "... are considered 'simple events'. > ServiceWorkerVersion::CreateSimpleEventCallback can be used to create the > callback for these". > > Otherwise it sounds like there is a material difference between how to dispatch > a simple event and non-simple event. Done.
The CQ bit was checked by leon.han@intel.com
The patchset sent to the CQ was uploaded after l-g-t-m from shimazu@chromium.org, falken@chromium.org Link to the patchset: https://codereview.chromium.org/2779093003/#ps40001 (title: "Refine comment")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
leon.han@intel.com changed reviewers: + tsepez@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
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_...)
The CQ bit was checked by leon.han@intel.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1490876689832950,
"parent_rev": "39d403eb61f5598b7308a36decfbfe8aaee3e97d", "commit_rev":
"29783ad5a5cbc0569d4a5578c82feca23223a621"}
Message was sent while issue was closed.
Description was changed from ========== [ServiceWorker] Remove useless ServiceWorkerVersion::DispatchSimpleEvent(). As all simple events have been converted into mojo interface ServiceWorkerEventDispatcher, now there are no codes using ServiceWorkerVersion::DispatchSimpleEvent(), so this CL removes it completely. No other code behavior change. BUG=629701 TBR=tsepez@chromium.org for adding comment into service_worker_event_dispatcher.mojom ========== to ========== [ServiceWorker] Remove useless ServiceWorkerVersion::DispatchSimpleEvent(). As all simple events have been converted into mojo interface ServiceWorkerEventDispatcher, now there are no codes using ServiceWorkerVersion::DispatchSimpleEvent(), so this CL removes it completely. No other code behavior change. BUG=629701 TBR=tsepez@chromium.org for adding comment into service_worker_event_dispatcher.mojom Review-Url: https://codereview.chromium.org/2779093003 Cr-Commit-Position: refs/heads/master@{#460744} Committed: https://chromium.googlesource.com/chromium/src/+/29783ad5a5cbc0569d4a5578c82f... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/29783ad5a5cbc0569d4a5578c82f... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
