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

Issue 2871513002: Worklet: Lazily create PaintWorkletGlobalScopes (Closed)

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

Description

Worklet: Lazily create PaintWorkletGlobalScopes Before this CL, PaintWorkletGlobalScope is created on the ctor of PaintWorklet. This behavior is not compatible with the Worklet spec. PaintWorkletGlobalScopes should be lazily created when addModule() is called. To fix it, this CL changes a timing to create PaintWorkletGlobalScopes and introduces PaintWorkletPendingGeneratorRegistry to keep pending generators until the first global scope is created. In addition, this CL enables PaintWorklet have multiple PaintWorkletGlobalScopes. This is also required by the spec. Spec: https://drafts.css-houdini.org/worklets/#dom-worklet-addmodule DesignDoc: https://docs.google.com/document/d/1cgLcrua7H_7x_o5GlzYrAi2qt-TqTzgtOeixFAugR6g/edit?usp=sharing BUG=627945 Review-Url: https://codereview.chromium.org/2871513002 Cr-Commit-Position: refs/heads/master@{#475337} Committed: https://chromium.googlesource.com/chromium/src/+/cb9819bdbebd43f5f2a9219dcb127a5368965dcb

Patch Set 1 #

Total comments: 4

Patch Set 2 : address review comments #

Patch Set 3 : clean up #

Patch Set 4 : fix test failures #

Patch Set 5 : add missing files #

Patch Set 6 : add class-level comments #

Total comments: 4

Patch Set 7 : maybe fix compile failures on android bots? #

Patch Set 8 : rebase #

Patch Set 9 : fix rebase failures #

Total comments: 5

Patch Set 10 : introduce WorkletGlobalScopeManager #

Patch Set 11 : clean up #

Total comments: 4

Patch Set 12 : merge WorkletGlobalScopeManager into MainThreadWorklet #

Patch Set 13 : fix layout test failures #

Total comments: 4

Patch Set 14 : add DCHECKs #

Total comments: 7

Patch Set 15 : rebase #

Patch Set 16 : keep PendingGeneratorRegistry in PaintWorklet #

Patch Set 17 : add more class-level comments #

Total comments: 6

Patch Set 18 : rebase #

Patch Set 19 : address review comments #

Patch Set 20 : fix wrong dcheck #

Unified diffs Side-by-side diffs Delta from patch set Stats (+205 lines, -76 lines) Patch
M third_party/WebKit/Source/core/workers/MainThreadWorklet.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +17 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/workers/ThreadedWorklet.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/Worklet.h View 1 2 3 4 5 6 7 2 chunks +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/BUILD.gn View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorklet.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +12 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +25 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +8 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +12 lines, -26 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +5 lines, -9 lines 0 comments Download
A third_party/WebKit/Source/modules/csspaint/PaintWorkletPendingGeneratorRegistry.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +42 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/modules/csspaint/PaintWorkletPendingGeneratorRegistry.cpp View 1 2 3 4 1 chunk +38 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +18 lines, -6 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 99 (69 generated)
nhiroki
PTAL, thanks!
3 years, 7 months ago (2017-05-08 09:22:09 UTC) #6
kouhei (in TOK)
https://codereview.chromium.org/2871513002/diff/1/third_party/WebKit/Source/core/workers/MainThreadWorklet.h File third_party/WebKit/Source/core/workers/MainThreadWorklet.h (right): https://codereview.chromium.org/2871513002/diff/1/third_party/WebKit/Source/core/workers/MainThreadWorklet.h#newcode44 third_party/WebKit/Source/core/workers/MainThreadWorklet.h:44: virtual void AddWorkletGlobalScopesIfNeeded() = 0; Can we have a ...
3 years, 7 months ago (2017-05-08 13:13:19 UTC) #10
nhiroki
Thanks for your review comments! I'll address them soon. By the way, I noticed this ...
3 years, 7 months ago (2017-05-09 00:10:07 UTC) #11
ikilpatrick
https://codereview.chromium.org/2871513002/diff/100001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/100001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode29 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:29: // TODO(nhiroki): Support the case where there are multiple ...
3 years, 7 months ago (2017-05-10 03:47:44 UTC) #28
nhiroki
Thank you! Updated. https://codereview.chromium.org/2871513002/diff/1/third_party/WebKit/Source/core/workers/MainThreadWorklet.h File third_party/WebKit/Source/core/workers/MainThreadWorklet.h (right): https://codereview.chromium.org/2871513002/diff/1/third_party/WebKit/Source/core/workers/MainThreadWorklet.h#newcode44 third_party/WebKit/Source/core/workers/MainThreadWorklet.h:44: virtual void AddWorkletGlobalScopesIfNeeded() = 0; On ...
3 years, 7 months ago (2017-05-10 09:01:32 UTC) #31
nhiroki
On 2017/05/09 00:10:07, nhiroki wrote: > Thanks for your review comments! I'll address them soon. ...
3 years, 7 months ago (2017-05-10 09:15:29 UTC) #32
kouhei (in TOK)
https://codereview.chromium.org/2871513002/diff/160001/third_party/WebKit/Source/core/workers/MainThreadWorklet.h File third_party/WebKit/Source/core/workers/MainThreadWorklet.h (right): https://codereview.chromium.org/2871513002/diff/160001/third_party/WebKit/Source/core/workers/MainThreadWorklet.h#newcode39 third_party/WebKit/Source/core/workers/MainThreadWorklet.h:39: WTF::HashSet<std::unique_ptr<WorkletGlobalScopeProxy>>& GetProxies() { I'd want to avoid this as ...
3 years, 7 months ago (2017-05-12 16:37:10 UTC) #46
falken
https://codereview.chromium.org/2871513002/diff/160001/third_party/WebKit/Source/core/workers/MainThreadWorklet.h File third_party/WebKit/Source/core/workers/MainThreadWorklet.h (right): https://codereview.chromium.org/2871513002/diff/160001/third_party/WebKit/Source/core/workers/MainThreadWorklet.h#newcode39 third_party/WebKit/Source/core/workers/MainThreadWorklet.h:39: WTF::HashSet<std::unique_ptr<WorkletGlobalScopeProxy>>& GetProxies() { On 2017/05/12 16:37:10, kouhei (travelling MTV) ...
3 years, 7 months ago (2017-05-15 05:14:49 UTC) #47
nhiroki
Thank you for your comments. I'm now back from OOO. https://codereview.chromium.org/2871513002/diff/160001/third_party/WebKit/Source/core/workers/MainThreadWorklet.h File third_party/WebKit/Source/core/workers/MainThreadWorklet.h (right): https://codereview.chromium.org/2871513002/diff/160001/third_party/WebKit/Source/core/workers/MainThreadWorklet.h#newcode39 ...
3 years, 7 months ago (2017-05-22 00:52:33 UTC) #48
kinuko
https://codereview.chromium.org/2871513002/diff/160001/third_party/WebKit/Source/core/workers/MainThreadWorklet.h File third_party/WebKit/Source/core/workers/MainThreadWorklet.h (right): https://codereview.chromium.org/2871513002/diff/160001/third_party/WebKit/Source/core/workers/MainThreadWorklet.h#newcode39 third_party/WebKit/Source/core/workers/MainThreadWorklet.h:39: WTF::HashSet<std::unique_ptr<WorkletGlobalScopeProxy>>& GetProxies() { On 2017/05/22 00:52:33, nhiroki (slow) wrote: ...
3 years, 7 months ago (2017-05-22 02:51:04 UTC) #51
ikilpatrick
lgtm https://codereview.chromium.org/2871513002/diff/100001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/100001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode29 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:29: // TODO(nhiroki): Support the case where there are ...
3 years, 7 months ago (2017-05-24 03:47:07 UTC) #52
nhiroki
Thank you for your comments! Updated. kouhei@, kinuko@, falken@: Can you take another look? https://codereview.chromium.org/2871513002/diff/100001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp ...
3 years, 7 months ago (2017-05-24 05:12:22 UTC) #55
kinuko
Thanks! A little more bike shedding comments... https://codereview.chromium.org/2871513002/diff/220001/third_party/WebKit/Source/core/workers/WorkletGlobalScopeManager.h File third_party/WebKit/Source/core/workers/WorkletGlobalScopeManager.h (right): https://codereview.chromium.org/2871513002/diff/220001/third_party/WebKit/Source/core/workers/WorkletGlobalScopeManager.h#newcode29 third_party/WebKit/Source/core/workers/WorkletGlobalScopeManager.h:29: void AddGlobalScope(std::unique_ptr<WorkletGlobalScopeProxy>); ...
3 years, 7 months ago (2017-05-24 06:53:40 UTC) #56
nhiroki
Thank you! Updated. https://codereview.chromium.org/2871513002/diff/220001/third_party/WebKit/Source/core/workers/WorkletGlobalScopeManager.h File third_party/WebKit/Source/core/workers/WorkletGlobalScopeManager.h (right): https://codereview.chromium.org/2871513002/diff/220001/third_party/WebKit/Source/core/workers/WorkletGlobalScopeManager.h#newcode29 third_party/WebKit/Source/core/workers/WorkletGlobalScopeManager.h:29: void AddGlobalScope(std::unique_ptr<WorkletGlobalScopeProxy>); On 2017/05/24 06:53:40, kinuko ...
3 years, 7 months ago (2017-05-24 08:11:23 UTC) #63
kinuko
Thanks! Works for me (lgtm)
3 years, 7 months ago (2017-05-24 08:21:33 UTC) #64
kouhei (in TOK)
lgtm https://codereview.chromium.org/2871513002/diff/260001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/260001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode64 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:64: if (GetNumberOfGlobalScopes() == 0) { DCHECK(pending_generator_registry_) https://codereview.chromium.org/2871513002/diff/260001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode68 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:68: ...
3 years, 7 months ago (2017-05-24 14:31:13 UTC) #67
nhiroki
Thank you! https://codereview.chromium.org/2871513002/diff/260001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/260001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode64 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:64: if (GetNumberOfGlobalScopes() == 0) { On 2017/05/24 ...
3 years, 7 months ago (2017-05-24 14:42:09 UTC) #69
falken
Sorry for the delay, I defer to others here. Let me know if there's something ...
3 years, 7 months ago (2017-05-25 00:30:58 UTC) #73
haraken
https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode67 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:67: pending_generator_registry_); I think this is the point of this ...
3 years, 7 months ago (2017-05-25 01:04:39 UTC) #75
nhiroki
Thank you! https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode67 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:67: pending_generator_registry_); On 2017/05/25 01:04:39, haraken wrote: > ...
3 years, 7 months ago (2017-05-25 06:23:23 UTC) #76
haraken
https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode67 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:67: pending_generator_registry_); On 2017/05/25 06:23:23, nhiroki wrote: > On 2017/05/25 ...
3 years, 7 months ago (2017-05-25 06:28:54 UTC) #77
nhiroki
https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode67 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:67: pending_generator_registry_); On 2017/05/25 06:28:53, haraken wrote: > On 2017/05/25 ...
3 years, 7 months ago (2017-05-25 07:24:08 UTC) #78
nhiroki
https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode67 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:67: pending_generator_registry_); On 2017/05/25 07:24:08, nhiroki wrote: > On 2017/05/25 ...
3 years, 7 months ago (2017-05-25 07:37:45 UTC) #79
ikilpatrick
https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp File third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/280001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp#newcode67 third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp:67: pending_generator_registry_); On 2017/05/25 07:37:44, nhiroki wrote: > On 2017/05/25 ...
3 years, 7 months ago (2017-05-25 21:58:53 UTC) #80
nhiroki
haraken@: Can you take another look? I made PaintWorklet keep the pending generator registry based ...
3 years, 6 months ago (2017-05-29 05:57:31 UTC) #85
haraken
LGTM https://codereview.chromium.org/2871513002/diff/340001/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp File third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/340001/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp#newcode79 third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp:79: DCHECK_LT(0u, GetNumberOfGlobalScopes()); DCHECK_EQ(1, GetNumberOfGlobalScopes()) at the moment? https://codereview.chromium.org/2871513002/diff/340001/third_party/WebKit/Source/core/workers/MainThreadWorklet.h ...
3 years, 6 months ago (2017-05-29 07:38:48 UTC) #88
nhiroki
Thank you! https://codereview.chromium.org/2871513002/diff/340001/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp File third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp (right): https://codereview.chromium.org/2871513002/diff/340001/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp#newcode79 third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp:79: DCHECK_LT(0u, GetNumberOfGlobalScopes()); On 2017/05/29 07:38:48, haraken wrote: ...
3 years, 6 months ago (2017-05-29 08:52:03 UTC) #89
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/2871513002/380001
3 years, 6 months ago (2017-05-29 08:53:33 UTC) #92
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/2871513002/400001
3 years, 6 months ago (2017-05-29 09:40:28 UTC) #96
commit-bot: I haz the power
3 years, 6 months ago (2017-05-29 11:51:47 UTC) #99
Message was sent while issue was closed.
Committed patchset #20 (id:400001) as
https://chromium.googlesource.com/chromium/src/+/cb9819bdbebd43f5f2a9219dcb12...

Powered by Google App Engine
This is Rietveld 408576698