Chromium Code Reviews
DescriptionCreate 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)
|