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

Issue 2549143009: Create PendingScriptClient as a separate client interface for PendingScript. (Closed)

Created:
4 years ago by jbroman
Modified:
4 years ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, kinuko+watch, loading-reviews+parser_chromium.org, rwlbuis, sof
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Create PendingScriptClient as a separate client interface for PendingScript. This is aimed toward making PendingScript's relationship with its client more clear and consistent. Currently, its client (a ScriptResourceClient) may or may not be added as a client of the ScriptResource, depending on whether or not a streamer is used. If a streamer is not used, then it's a direct client (which means that in this scenario watchForLoad will call notifyFinished if the script is already loaded); if it is, then PendingScript emits the callbacks instead of the resource (when the streamer finishes), but it doesn't perfectly emulate ScriptResource (it doesn't call the finished method when the client is added if the resource is already finished, and it doesn't call other methods like debugName and notifyAppendData). This patch makes a narrower PendingScriptClient interface for clients of the PendingScript to use, and PendingScript handles dispatching to the client, rather than sometimes delegating this responsibility to the resource itself. This also simplifies some code which was using the Resource* to look up the PendingScript*, which can now be provided directly to the client method. Committed: https://crrev.com/fda40a4d70c58633f45979b58efb23ee213f7802 Cr-Commit-Position: refs/heads/master@{#438433}

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Total comments: 1

Messages

Total messages: 28 (19 generated)
jbroman
I found this division in who calls the ScriptResourceClient of a PendingScript confusing; to me ...
4 years ago (2016-12-09 15:59:35 UTC) #13
kouhei (in TOK)
lgtm This is a lot simpler. https://codereview.chromium.org/2549143009/diff/40001/third_party/WebKit/Source/core/dom/PendingScript.cpp File third_party/WebKit/Source/core/dom/PendingScript.cpp (right): https://codereview.chromium.org/2549143009/diff/40001/third_party/WebKit/Source/core/dom/PendingScript.cpp#newcode93 third_party/WebKit/Source/core/dom/PendingScript.cpp:93: m_client->pendingScriptFinished(this); Wow. Thanks ...
4 years ago (2016-12-12 01:37:06 UTC) #14
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/2549143009/40001
4 years ago (2016-12-13 15:42:34 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/324791)
4 years ago (2016-12-13 15:51:09 UTC) #18
jbroman
+haraken for ScriptStreamerTest.cpp Just a replace of TestScriptResourceClient with TestPendingScriptClient.
4 years ago (2016-12-13 15:56:18 UTC) #20
haraken
On 2016/12/13 15:56:18, jbroman wrote: > +haraken for ScriptStreamerTest.cpp > > Just a replace of ...
4 years ago (2016-12-14 02:15:07 UTC) #21
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/2549143009/40001
4 years ago (2016-12-14 04:04:28 UTC) #23
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years ago (2016-12-14 04:50:33 UTC) #26
commit-bot: I haz the power
4 years ago (2016-12-14 04:52:36 UTC) #28
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/fda40a4d70c58633f45979b58efb23ee213f7802
Cr-Commit-Position: refs/heads/master@{#438433}

Powered by Google App Engine
This is Rietveld 408576698