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

Issue 2227593002: ServiceWorker: Implement StartWorker by using mojo (Closed)

Created:
4 years, 4 months ago by shimazu
Modified:
4 years, 2 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, blink-worker-reviews_chromium.org, chromium-reviews, darin (slow to review), darin-cc_chromium.org, horo+watch_chromium.org, jam, jsbell+serviceworker_chromium.org, kinuko+serviceworker, kinuko+watch, michaeln, mlamouri+watch-content_chromium.org, nhiroki, qsr+mojo_chromium.org, serviceworker-reviews, tzik, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ServiceWorker: Implement StartWorker by using mojo This patch is the first step of mojofication on the service worker. In this patch, EWInstance will send StartWorker IPC using mojo. The endpoint on the renderer process is EWInstanceClient which is corresponding to one EWInstance. In future, this enables us to remove EWDispatcher, but EWInstanceClient has reference to EWDispatcher for now. BUG=629701 Committed: https://crrev.com/5db8eb672a52385059d4d188e27d7a7f0a5dd29d Cr-Commit-Position: refs/heads/master@{#421427}

Patch Set 1 #

Patch Set 2 : Remove dependency #

Patch Set 3 : Move an end point of mojo from EmbeddedWorkerRegistry to EmbeddedWorkerInstance #

Patch Set 4 : Add TODO comments #

Patch Set 5 : Pass params when calling StartWorker #

Patch Set 6 : Add switch '--mojo-service-worker' and rebase #

Patch Set 7 : Renamed EWRegistryClient to EWInstanceClient and implemented StartWorker #

Patch Set 8 : Rebase #

Total comments: 16

Patch Set 9 : Update unittest for EmbeddedWorkerInstance #

Patch Set 10 : Updated the process of establishing connection, assert and misc things #

Patch Set 11 : Removed an unused function #

Total comments: 4

Patch Set 12 : Rebased and added to BUILD.gn #

Patch Set 13 : Use ON_CALL to be able to override the mock object #

Patch Set 14 : Added argument check and updated comment and BUILD.gn #

Total comments: 29

Patch Set 15 : Used typemap and TEST_P #

Patch Set 16 : Removed gmock and web_preferences.mojom #

Patch Set 17 : Removed a variadic template and moved some codes into dispatcher #

Patch Set 18 : Initialized StartParams #

Total comments: 22

Patch Set 19 : Incorporated with the comments #

Total comments: 6

Patch Set 20 : Updated comments #

Total comments: 2

Patch Set 21 : Used MakeStrongBinding #

Patch Set 22 : Added EmbeddedWorkerInstanceClient as an interface #

Unified diffs Side-by-side diffs Delta from patch set Stats (+567 lines, -142 lines) Patch
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 6 chunks +10 lines, -3 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 14 chunks +55 lines, -26 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 20 chunks +59 lines, -20 lines 0 comments Download
M content/browser/service_worker/embedded_worker_registry.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +11 lines, -6 lines 0 comments Download
M content/browser/service_worker/embedded_worker_registry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +17 lines, -2 lines 0 comments Download
M content/browser/service_worker/embedded_worker_test_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +45 lines, -5 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 14 15 16 17 18 19 20 5 chunks +78 lines, -11 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 14 2 chunks +2 lines, -2 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 13 14 15 16 17 18 19 20 2 chunks +3 lines, -2 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 2 chunks +3 lines, -0 lines 0 comments Download
A content/common/service_worker/embedded_worker.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +16 lines, -0 lines 0 comments Download
A content/common/service_worker/embedded_worker.typemap View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +10 lines, -0 lines 0 comments Download
M content/common/service_worker/embedded_worker_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +13 lines, -12 lines 0 comments Download
A content/common/service_worker/embedded_worker_start_params.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +30 lines, -0 lines 0 comments Download
A + content/common/service_worker/embedded_worker_start_params.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +2 lines, -4 lines 0 comments Download
M content/common/service_worker/service_worker_utils.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_utils.cc View 1 2 3 4 5 2 chunks +7 lines, -0 lines 0 comments Download
M content/common/typemaps.gni View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M content/public/app/mojo/content_renderer_manifest.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +6 lines, -2 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +36 lines, -3 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +47 lines, -44 lines 0 comments Download
A content/renderer/service_worker/embedded_worker_instance_client_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +38 lines, -0 lines 0 comments Download
A content/renderer/service_worker/embedded_worker_instance_client_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +62 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/VirtualTestSuites View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +5 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/mojo-service-worker/http/tests/serviceworker/README.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 60 (29 generated)
shimazu
Could you take a look at this CL as is? I'm going to add unitttests ...
4 years, 4 months ago (2016-08-23 08:40:13 UTC) #3
Marijn Kruisselbrink
Awesome, I once tried to do something similar myself (https://codereview.chromium.org/1223193009), just to see how complicated ...
4 years, 4 months ago (2016-08-23 18:56:09 UTC) #9
horo
https://codereview.chromium.org/2227593002/diff/140001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2227593002/diff/140001/content/browser/service_worker/embedded_worker_instance.cc#newcode623 content/browser/service_worker/embedded_worker_instance.cc:623: static_cast<mojom::V8CacheOptions>(params->settings.v8_cache_options); We should have static_assert() for mojo::V8CacheOptions and content::V8CacheOptions. ...
4 years, 4 months ago (2016-08-24 04:59:16 UTC) #10
shimazu
Thanks for your comments! :) Added a unit test and revised this CL. ptal again. ...
4 years, 3 months ago (2016-08-25 05:14:53 UTC) #18
shimazu
dcheng@, could you take a look around mojo? Especially I'd like to know base::Unretained doesn't ...
4 years, 3 months ago (2016-08-25 05:26:16 UTC) #20
horo
https://codereview.chromium.org/2227593002/diff/140001/content/public/common/BUILD.gn File content/public/common/BUILD.gn (right): https://codereview.chromium.org/2227593002/diff/140001/content/public/common/BUILD.gn#newcode175 content/public/common/BUILD.gn:175: # This interface is internal to content. However, this ...
4 years, 3 months ago (2016-08-30 03:18:05 UTC) #23
shimazu
Updated. ptal:) dcheng@: ping, kindly? https://codereview.chromium.org/2227593002/diff/140001/content/public/common/BUILD.gn File content/public/common/BUILD.gn (right): https://codereview.chromium.org/2227593002/diff/140001/content/public/common/BUILD.gn#newcode175 content/public/common/BUILD.gn:175: # This interface is ...
4 years, 3 months ago (2016-09-02 03:05:05 UTC) #25
horo
lgtm But please ensure that base::Unretained(embedded_worker_dispatcher_.get()) in RenderThreadImpl::Init() is safe.
4 years, 3 months ago (2016-09-05 03:40:38 UTC) #26
falken
drive by comments https://codereview.chromium.org/2227593002/diff/300001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2227593002/diff/300001/content/browser/service_worker/embedded_worker_instance.cc#newcode74 content/browser/service_worker/embedded_worker_instance.cc:74: void RegisterToWorkerDevToolsManagerAndBindInterfaceOnUI( These are now two ...
4 years, 3 months ago (2016-09-07 05:01:42 UTC) #28
dcheng
https://codereview.chromium.org/2227593002/diff/300001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2227593002/diff/300001/content/browser/service_worker/embedded_worker_instance.cc#newcode589 content/browser/service_worker/embedded_worker_instance.cc:589: auto mojo_params = mojom::EmbeddedWorkerStartWorkerParams::New(); It might be slightly simpler ...
4 years, 3 months ago (2016-09-07 07:51:10 UTC) #29
shimazu
PTAL again :D https://codereview.chromium.org/2227593002/diff/300001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2227593002/diff/300001/content/browser/service_worker/embedded_worker_instance.cc#newcode74 content/browser/service_worker/embedded_worker_instance.cc:74: void RegisterToWorkerDevToolsManagerAndBindInterfaceOnUI( On 2016/09/07 05:01:41, falken ...
4 years, 3 months ago (2016-09-12 06:28:20 UTC) #32
falken
Sorry for the delay, another round of comments. (If possible, it's good to break big ...
4 years, 3 months ago (2016-09-13 05:48:03 UTC) #33
shimazu
Thanks for your comments. PTAL again:) https://codereview.chromium.org/2227593002/diff/420001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2227593002/diff/420001/content/browser/service_worker/embedded_worker_instance.cc#newcode591 content/browser/service_worker/embedded_worker_instance.cc:591: return; On 2016/09/13 ...
4 years, 3 months ago (2016-09-15 03:24:42 UTC) #34
falken
Apologies again. https://codereview.chromium.org/2227593002/diff/440001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2227593002/diff/440001/content/browser/service_worker/embedded_worker_instance.cc#newcode355 content/browser/service_worker/embedded_worker_instance.cc:355: scope, is_installed_, base::Passed(&request_), Is it ok to ...
4 years, 3 months ago (2016-09-20 03:03:32 UTC) #35
shimazu
Thanks for your comments. Updated. https://codereview.chromium.org/2227593002/diff/440001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2227593002/diff/440001/content/browser/service_worker/embedded_worker_instance.cc#newcode355 content/browser/service_worker/embedded_worker_instance.cc:355: scope, is_installed_, base::Passed(&request_), On ...
4 years, 3 months ago (2016-09-20 05:37:30 UTC) #36
shimazu
https://codereview.chromium.org/2227593002/diff/440001/content/browser/service_worker/embedded_worker_instance.h File content/browser/service_worker/embedded_worker_instance.h (right): https://codereview.chromium.org/2227593002/diff/440001/content/browser/service_worker/embedded_worker_instance.h#newcode312 content/browser/service_worker/embedded_worker_instance.h:312: // These are connected to a renderer process after ...
4 years, 3 months ago (2016-09-20 05:38:09 UTC) #37
falken
OK lgtm
4 years, 3 months ago (2016-09-20 05:40:35 UTC) #38
shimazu
avi@: Please review changes in the following: - content/browser/renderer_host - content/renderer/renderer_thread_impl.cc - content/public - BUILD.gn, ...
4 years, 3 months ago (2016-09-20 05:49:53 UTC) #40
shimazu
avi@: Please review changes in the following: - content/browser/renderer_host - content/renderer/renderer_thread_impl.cc - content/public - BUILD.gn, ...
4 years, 3 months ago (2016-09-20 05:49:54 UTC) #41
Avi (use Gerrit)
lgtm stampity stamp
4 years, 3 months ago (2016-09-20 14:05:56 UTC) #42
dcheng
ipc + mojom lgtm https://codereview.chromium.org/2227593002/diff/300001/content/renderer/service_worker/embedded_worker_instance_client_impl.cc File content/renderer/service_worker/embedded_worker_instance_client_impl.cc (right): https://codereview.chromium.org/2227593002/diff/300001/content/renderer/service_worker/embedded_worker_instance_client_impl.cc#newcode43 content/renderer/service_worker/embedded_worker_instance_client_impl.cc:43: start_data.scriptURL = params->script_url; On 2016/09/12 ...
4 years, 3 months ago (2016-09-21 08:21:17 UTC) #43
shimazu
https://codereview.chromium.org/2227593002/diff/460001/content/renderer/service_worker/embedded_worker_instance_client_impl.cc File content/renderer/service_worker/embedded_worker_instance_client_impl.cc (right): https://codereview.chromium.org/2227593002/diff/460001/content/renderer/service_worker/embedded_worker_instance_client_impl.cc#newcode24 content/renderer/service_worker/embedded_worker_instance_client_impl.cc:24: new EmbeddedWorkerInstanceClientImpl(dispatcher, std::move(request)); On 2016/09/21 08:21:17, dcheng wrote: > ...
4 years, 3 months ago (2016-09-23 03:04:40 UTC) #46
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/2227593002/480001
4 years, 3 months ago (2016-09-23 03:04:40 UTC) #47
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/302923)
4 years, 3 months ago (2016-09-23 04:03:09 UTC) #49
shimazu
On 2016/09/23 04:03:09, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years, 3 months ago (2016-09-23 07:54:53 UTC) #50
shimazu
dcheng@: could you check the json just in case? Is it enough to add a ...
4 years, 3 months ago (2016-09-23 11:43:09 UTC) #51
dcheng
json LGTM
4 years, 2 months ago (2016-09-27 16:53:30 UTC) #52
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/2227593002/500001
4 years, 2 months ago (2016-09-28 00:14:37 UTC) #55
commit-bot: I haz the power
Committed patchset #22 (id:500001)
4 years, 2 months ago (2016-09-28 02:10:34 UTC) #57
commit-bot: I haz the power
Patchset 22 (id:??) landed as https://crrev.com/5db8eb672a52385059d4d188e27d7a7f0a5dd29d Cr-Commit-Position: refs/heads/master@{#421427}
4 years, 2 months ago (2016-09-28 02:12:50 UTC) #59
jwd
4 years, 2 months ago (2016-09-28 13:58:25 UTC) #60
Message was sent while issue was closed.
A revert of this CL (patchset #22 id:500001) has been created in
https://codereview.chromium.org/2381513002/ by jwd@chromium.org.

The reason for reverting is: Looks like this is causing failures on webkit
builders
https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linu...
.

Powered by Google App Engine
This is Rietveld 408576698