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

Issue 2178223002: Refactor Worklet class to use ScriptResource (Closed)

Created:
4 years, 5 months ago by Gleb Lanbin
Modified:
4 years, 4 months ago
CC:
blink-reviews, blink-worker-reviews_chromium.org, chromium-reviews, falken, horo+watch_chromium.org, kinuko+worker_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor Worklet class to use ScriptResource. Following the recommendations discussed in http://crrev.com/2146633002, this patch switches Worklet.cpp to use ScriptResource to load a worklet script, so it can follow the code path defined in FrameFetchContext::canRequest for CSP checks. BUG=567358 Committed: https://crrev.com/b456ae94c7e484d0ad50584333914c1e1b5f462f Cr-Commit-Position: refs/heads/master@{#409232}

Patch Set 1 #

Total comments: 2

Patch Set 2 : add missing files #

Total comments: 2

Patch Set 3 : add tests, DCHECK(frame) #

Total comments: 13

Patch Set 4 : set m_fetcher in initialization list, s/override/final, copyright etc. #

Total comments: 8

Patch Set 5 : fixed comments & synced to the HEAD #

Total comments: 13

Patch Set 6 : removed redundant ExecutionContext parameter, changed WorkletScriptLoader to inherit from ResourceO… #

Total comments: 8

Patch Set 7 : add WorkletScriptLoader::cancel, remove m_resources #

Patch Set 8 : synced to the head #

Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -97 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html View 1 2 1 chunk +24 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked-expected.txt View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp View 1 2 3 4 5 1 chunk +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/WindowAnimationWorklet.h View 1 2 3 4 5 2 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/WindowAnimationWorklet.cpp View 1 2 3 4 5 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/WindowAnimationWorklet.idl View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/csspaint/CSSPaintImageGeneratorImpl.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorklet.h View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp View 1 2 3 4 5 1 chunk +5 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.cpp View 1 2 3 4 5 6 7 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.idl View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/modules.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/worklet/ThreadedWorkletGlobalScopeProxy.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/worklet/Worklet.h View 1 2 3 4 5 6 2 chunks +11 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/modules/worklet/Worklet.cpp View 1 2 3 4 5 6 2 chunks +25 lines, -47 lines 0 comments Download
A third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.h View 1 2 3 4 5 6 1 chunk +54 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.cpp View 1 2 3 4 5 6 1 chunk +50 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (9 generated)
ikilpatrick
https://codereview.chromium.org/2178223002/diff/1/third_party/WebKit/Source/modules/modules.gypi File third_party/WebKit/Source/modules/modules.gypi (right): https://codereview.chromium.org/2178223002/diff/1/third_party/WebKit/Source/modules/modules.gypi#newcode1979 third_party/WebKit/Source/modules/modules.gypi:1979: 'worklet/WorkletScriptLoader.cpp', missing file from patch?
4 years, 4 months ago (2016-07-26 18:16:54 UTC) #2
Gleb Lanbin
https://codereview.chromium.org/2178223002/diff/1/third_party/WebKit/Source/modules/modules.gypi File third_party/WebKit/Source/modules/modules.gypi (right): https://codereview.chromium.org/2178223002/diff/1/third_party/WebKit/Source/modules/modules.gypi#newcode1979 third_party/WebKit/Source/modules/modules.gypi:1979: 'worklet/WorkletScriptLoader.cpp', On 2016/07/26 18:16:54, ikilpatrick wrote: > missing file ...
4 years, 4 months ago (2016-07-26 18:29:23 UTC) #3
yhirano
https://codereview.chromium.org/2178223002/diff/20001/third_party/WebKit/Source/modules/worklet/Worklet.h File third_party/WebKit/Source/modules/worklet/Worklet.h (right): https://codereview.chromium.org/2178223002/diff/20001/third_party/WebKit/Source/modules/worklet/Worklet.h#newcode41 third_party/WebKit/Source/modules/worklet/Worklet.h:41: explicit Worklet(ExecutionContext*, LocalFrame*); Could you tell me when the ...
4 years, 4 months ago (2016-07-27 09:09:46 UTC) #5
Gleb Lanbin
On 2016/07/27 09:09:46, yhirano wrote: > https://codereview.chromium.org/2178223002/diff/20001/third_party/WebKit/Source/modules/worklet/Worklet.h > File third_party/WebKit/Source/modules/worklet/Worklet.h (right): > > https://codereview.chromium.org/2178223002/diff/20001/third_party/WebKit/Source/modules/worklet/Worklet.h#newcode41 > ...
4 years, 4 months ago (2016-07-27 23:21:17 UTC) #8
ikilpatrick
https://codereview.chromium.org/2178223002/diff/20001/third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.cpp File third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.cpp (right): https://codereview.chromium.org/2178223002/diff/20001/third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.cpp#newcode1 third_party/WebKit/Source/modules/worklet/WorkletScriptLoader.cpp:1: missing copyright. https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h File third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h (right): https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h#newcode26 third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h:26: void ...
4 years, 4 months ago (2016-07-28 00:12:44 UTC) #9
haraken
https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h File third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h (right): https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h#newcode26 third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h:26: void evaluateScript(const ScriptSourceCode&) final; On 2016/07/28 00:12:44, ikilpatrick wrote: ...
4 years, 4 months ago (2016-07-28 08:52:06 UTC) #11
yhirano
https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/modules/worklet/Worklet.cpp File third_party/WebKit/Source/modules/worklet/Worklet.cpp (right): https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/modules/worklet/Worklet.cpp#newcode27 third_party/WebKit/Source/modules/worklet/Worklet.cpp:27: m_fetcher = ResourceFetcher::create(/* context */ nullptr); I still don't ...
4 years, 4 months ago (2016-07-28 14:41:10 UTC) #12
ikilpatrick
https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h File third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h (right): https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h#newcode26 third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h:26: void evaluateScript(const ScriptSourceCode&) final; On 2016/07/28 08:52:05, haraken wrote: ...
4 years, 4 months ago (2016-07-28 18:48:41 UTC) #13
Gleb Lanbin
PTAL https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/modules/worklet/Worklet.cpp File third_party/WebKit/Source/modules/worklet/Worklet.cpp (right): https://codereview.chromium.org/2178223002/diff/40001/third_party/WebKit/Source/modules/worklet/Worklet.cpp#newcode27 third_party/WebKit/Source/modules/worklet/Worklet.cpp:27: m_fetcher = ResourceFetcher::create(/* context */ nullptr); On 2016/07/28 ...
4 years, 4 months ago (2016-07-28 20:43:29 UTC) #14
ikilpatrick
lgtm but obviously wait for mike and either haraken or yhirano :) https://codereview.chromium.org/2178223002/diff/60001/third_party/WebKit/Source/modules/worklet/Worklet.cpp File third_party/WebKit/Source/modules/worklet/Worklet.cpp ...
4 years, 4 months ago (2016-07-28 22:42:10 UTC) #15
Gleb Lanbin
thanks for the review. https://codereview.chromium.org/2178223002/diff/60001/third_party/WebKit/Source/modules/worklet/Worklet.cpp File third_party/WebKit/Source/modules/worklet/Worklet.cpp (right): https://codereview.chromium.org/2178223002/diff/60001/third_party/WebKit/Source/modules/worklet/Worklet.cpp#newcode28 third_party/WebKit/Source/modules/worklet/Worklet.cpp:28: KURL scriptURL = getExecutionContext()->completeURL(url); On ...
4 years, 4 months ago (2016-07-29 01:40:23 UTC) #16
yhirano
https://codereview.chromium.org/2178223002/diff/80001/third_party/WebKit/Source/modules/worklet/Worklet.cpp File third_party/WebKit/Source/modules/worklet/Worklet.cpp (right): https://codereview.chromium.org/2178223002/diff/80001/third_party/WebKit/Source/modules/worklet/Worklet.cpp#newcode21 third_party/WebKit/Source/modules/worklet/Worklet.cpp:21: Worklet::Worklet(ExecutionContext* executionContext, LocalFrame* frame) Can you tell me the ...
4 years, 4 months ago (2016-07-29 02:19:23 UTC) #17
haraken
https://codereview.chromium.org/2178223002/diff/80001/third_party/WebKit/Source/modules/worklet/Worklet.cpp File third_party/WebKit/Source/modules/worklet/Worklet.cpp (right): https://codereview.chromium.org/2178223002/diff/80001/third_party/WebKit/Source/modules/worklet/Worklet.cpp#newcode21 third_party/WebKit/Source/modules/worklet/Worklet.cpp:21: Worklet::Worklet(ExecutionContext* executionContext, LocalFrame* frame) On 2016/07/29 02:19:23, yhirano wrote: ...
4 years, 4 months ago (2016-07-29 08:26:35 UTC) #18
Gleb Lanbin
PTAL https://codereview.chromium.org/2178223002/diff/80001/third_party/WebKit/Source/modules/worklet/Worklet.cpp File third_party/WebKit/Source/modules/worklet/Worklet.cpp (right): https://codereview.chromium.org/2178223002/diff/80001/third_party/WebKit/Source/modules/worklet/Worklet.cpp#newcode21 third_party/WebKit/Source/modules/worklet/Worklet.cpp:21: Worklet::Worklet(ExecutionContext* executionContext, LocalFrame* frame) On 2016/07/29 08:26:35, haraken ...
4 years, 4 months ago (2016-07-29 19:23:14 UTC) #19
yhirano
https://codereview.chromium.org/2178223002/diff/100001/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h File third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h (right): https://codereview.chromium.org/2178223002/diff/100001/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h#newcode29 third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h:29: AnimationWorklet(LocalFrame*); +explicit https://codereview.chromium.org/2178223002/diff/100001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h File third_party/WebKit/Source/modules/csspaint/PaintWorklet.h (right): https://codereview.chromium.org/2178223002/diff/100001/third_party/WebKit/Source/modules/csspaint/PaintWorklet.h#newcode31 third_party/WebKit/Source/modules/csspaint/PaintWorklet.h:31: PaintWorklet(LocalFrame*); ...
4 years, 4 months ago (2016-08-01 10:56:28 UTC) #20
Gleb Lanbin
https://codereview.chromium.org/2178223002/diff/100001/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h File third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h (right): https://codereview.chromium.org/2178223002/diff/100001/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h#newcode29 third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.h:29: AnimationWorklet(LocalFrame*); On 2016/08/01 10:56:27, yhirano wrote: > +explicit Done. ...
4 years, 4 months ago (2016-08-01 19:49:51 UTC) #21
yhirano
lgtm
4 years, 4 months ago (2016-08-01 22:35:27 UTC) #22
haraken
LGTM
4 years, 4 months ago (2016-08-02 04:04:49 UTC) #23
Mike West
LGTM 4. Thanks!
4 years, 4 months ago (2016-08-02 07:37:00 UTC) #24
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/2178223002/140001
4 years, 4 months ago (2016-08-02 16:18:57 UTC) #27
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 4 months ago (2016-08-02 17:50:46 UTC) #29
commit-bot: I haz the power
4 years, 4 months ago (2016-08-02 17:53:30 UTC) #31
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/b456ae94c7e484d0ad50584333914c1e1b5f462f
Cr-Commit-Position: refs/heads/master@{#409232}

Powered by Google App Engine
This is Rietveld 408576698