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

Issue 2657823002: Worklet: Straighten layering of worklet script loading (Closed)

Created:
3 years, 11 months ago by nhiroki
Modified:
3 years, 11 months ago
CC:
chromium-reviews, tfarina, shimazu+worker_chromium.org, kinuko+worker_chromium.org, blink-reviews, horo+watch_chromium.org, falken+watch_chromium.org, blink-worker-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Worklet: Straighten layering of worklet script loading This is a preparation to switch Worklet to module script loading. Before this CL, WorkletScriptLoader is entangled with Worklet. Worklet fetches a script and passes it to WorkletScriptLoader with a promise resolver. Then, WorkletScriptLoader loads it and settles the resolver. After this CL, WorkletScriptLoader dedicates to script fetching and loading. WorkletScriptLoader provides Client interface so that a loader client can receive notifications from the loader. Worklet no longer takes care of script fetching. Worklet implements the Client interface to wait for completion of resource loading, evaluates a script and settles a resolver. BUG=627945 Review-Url: https://codereview.chromium.org/2657823002 Cr-Commit-Position: refs/heads/master@{#446608} Committed: https://chromium.googlesource.com/chromium/src/+/f1e393e2cab401597d52fe9b7ed90946c5d426d3

Patch Set 1 #

Total comments: 4

Patch Set 2 : maybe fix compile failures on win bots #

Total comments: 10

Patch Set 3 : address review comments #

Patch Set 4 : rebase #

Patch Set 5 : remove unnecessary header inclusions #

Patch Set 6 : fix #

Total comments: 5

Patch Set 7 : take ResourceFetcher* directly #

Total comments: 8

Patch Set 8 : clean up #

Patch Set 9 : address yhirano's comments #

Patch Set 10 : clean up #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -91 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/workers/Worklet.h View 1 2 3 4 4 chunks +11 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/workers/Worklet.cpp View 1 2 3 4 5 6 7 2 chunks +30 lines, -32 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkletScriptLoader.h View 1 2 3 4 5 6 7 8 9 2 chunks +35 lines, -22 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +44 lines, -18 lines 0 comments Download

Messages

Total messages: 59 (41 generated)
nhiroki
PTAL, thanks!
3 years, 11 months ago (2017-01-25 08:49:35 UTC) #7
yhirano
https://codereview.chromium.org/2657823002/diff/20001/third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js File third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js (right): https://codereview.chromium.org/2657823002/diff/20001/third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js#newcode24 third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js:24: assert_unreached('unexpected rejection: ' + error); You don't need this ...
3 years, 11 months ago (2017-01-25 10:49:21 UTC) #12
kouhei (in TOK)
Thanks! I think this is a great step forward. Let me clarify high-level design first. ...
3 years, 11 months ago (2017-01-25 11:32:40 UTC) #13
nhiroki
Thanks for your comments. Updated. https://codereview.chromium.org/2657823002/diff/40001/third_party/WebKit/Source/core/workers/Worklet.cpp File third_party/WebKit/Source/core/workers/Worklet.cpp (right): https://codereview.chromium.org/2657823002/diff/40001/third_party/WebKit/Source/core/workers/Worklet.cpp#newcode37 third_party/WebKit/Source/core/workers/Worklet.cpp:37: m_loaderAndResolvers.set(scriptLoader, resolver); On 2017/01/25 ...
3 years, 11 months ago (2017-01-26 10:36:20 UTC) #26
nhiroki
Thank you! On 2017/01/25 11:32:40, kouhei wrote: > Thanks! I think this is a great ...
3 years, 11 months ago (2017-01-26 10:39:19 UTC) #27
kouhei (in TOK)
mostly lg https://codereview.chromium.org/2657823002/diff/120001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp File third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp (right): https://codereview.chromium.org/2657823002/diff/120001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp#newcode17 third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp:17: : m_fetcher(frame->document()->fetcher()), m_client(client) {} Take ResourceFetcher* directly. ...
3 years, 11 months ago (2017-01-26 11:52:47 UTC) #29
nhiroki
Thank you. Updated. https://codereview.chromium.org/2657823002/diff/120001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp File third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp (right): https://codereview.chromium.org/2657823002/diff/120001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp#newcode17 third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp:17: : m_fetcher(frame->document()->fetcher()), m_client(client) {} On 2017/01/26 ...
3 years, 11 months ago (2017-01-26 13:03:24 UTC) #34
kouhei (in TOK)
lgtm myside. Up to toyoshim@, yhirano@ https://codereview.chromium.org/2657823002/diff/140001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp File third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp (right): https://codereview.chromium.org/2657823002/diff/140001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp#newcode36 third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp:36: m_client->notifyWorkletScriptLoadingFinished(this, ScriptSourceCode()); Do ...
3 years, 11 months ago (2017-01-26 17:08:35 UTC) #37
yhirano
Please see my comments on PS1. https://codereview.chromium.org/2657823002/diff/140001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp File third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp (right): https://codereview.chromium.org/2657823002/diff/140001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp#newcode19 third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp:19: DCHECK(isMainThread()); DCHECK(!m_wasScriptLoadSuccessful); and ...
3 years, 11 months ago (2017-01-27 03:46:10 UTC) #39
nhiroki
Updated. https://codereview.chromium.org/2657823002/diff/140001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp File third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp (right): https://codereview.chromium.org/2657823002/diff/140001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp#newcode36 third_party/WebKit/Source/core/workers/WorkletScriptLoader.cpp:36: m_client->notifyWorkletScriptLoadingFinished(this, ScriptSourceCode()); On 2017/01/26 17:08:35, kouhei wrote: > ...
3 years, 11 months ago (2017-01-27 03:47:27 UTC) #41
nhiroki
Thank you! Updated. https://codereview.chromium.org/2657823002/diff/20001/third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js File third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js (right): https://codereview.chromium.org/2657823002/diff/20001/third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js#newcode24 third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js:24: assert_unreached('unexpected rejection: ' + error); On ...
3 years, 11 months ago (2017-01-27 04:40:33 UTC) #46
nhiroki
On 2017/01/27 03:46:10, yhirano wrote: > Please see my comments on PS1. Sorry, I missed ...
3 years, 11 months ago (2017-01-27 04:40:58 UTC) #47
yhirano
lgtm
3 years, 11 months ago (2017-01-27 04:53:49 UTC) #48
Takashi Toyoshima
no additional comments from my side. lgtm.
3 years, 11 months ago (2017-01-27 06:04:44 UTC) #51
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/2657823002/200001
3 years, 11 months ago (2017-01-27 06:18:52 UTC) #54
Takashi Toyoshima
https://codereview.chromium.org/2657823002/diff/120001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.h File third_party/WebKit/Source/core/workers/WorkletScriptLoader.h (right): https://codereview.chromium.org/2657823002/diff/120001/third_party/WebKit/Source/core/workers/WorkletScriptLoader.h#newcode22 third_party/WebKit/Source/core/workers/WorkletScriptLoader.h:22: // TODO(nhiroki): Switch to module script loading (https://crbug.com/627945) would ...
3 years, 11 months ago (2017-01-27 06:21:18 UTC) #55
commit-bot: I haz the power
Committed patchset #10 (id:200001) as https://chromium.googlesource.com/chromium/src/+/f1e393e2cab401597d52fe9b7ed90946c5d426d3
3 years, 11 months ago (2017-01-27 06:23:48 UTC) #58
nhiroki
3 years, 11 months ago (2017-01-27 07:00:46 UTC) #59
Message was sent while issue was closed.
https://codereview.chromium.org/2657823002/diff/120001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/workers/WorkletScriptLoader.h (right):

https://codereview.chromium.org/2657823002/diff/120001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/workers/WorkletScriptLoader.h:22: //
TODO(nhiroki): Switch to module script loading (https://crbug.com/627945)
On 2017/01/27 06:21:18, toyoshim wrote:
> would be nice, but probably in another CL?

Thanks! I'll make a follow-up CL :)

> We also have two (+one more your WIP) different *ScriptLoader.cpp outside
> core/loader now.

I lied to you over chat. ModuleScriptLoader is under core/loader :p
https://codereview.chromium.org/2555653002/

Powered by Google App Engine
This is Rietveld 408576698