| Index: third_party/WebKit/Source/core/dom/PendingScript.h
|
| diff --git a/third_party/WebKit/Source/core/dom/PendingScript.h b/third_party/WebKit/Source/core/dom/PendingScript.h
|
| index b29c0fa61c3f2c59f8a0b53b6ca9135ff25fb7b6..fa93534bb18539165a05ec5ed1f81f702fd691a5 100644
|
| --- a/third_party/WebKit/Source/core/dom/PendingScript.h
|
| +++ b/third_party/WebKit/Source/core/dom/PendingScript.h
|
| @@ -38,8 +38,22 @@
|
| namespace blink {
|
|
|
| class Element;
|
| +class PendingScript;
|
| class ScriptSourceCode;
|
|
|
| +class CORE_EXPORT PendingScriptClient : public GarbageCollectedMixin {
|
| + public:
|
| + virtual ~PendingScriptClient() {}
|
| +
|
| + // Invoked when the pending script has finished loading. This could be during
|
| + // |watchForLoad| (if the pending script was already ready), or when the
|
| + // resource loads (if script streaming is not occurring), or when script
|
| + // streaming finishes.
|
| + virtual void pendingScriptFinished(PendingScript*) = 0;
|
| +
|
| + DEFINE_INLINE_VIRTUAL_TRACE() {}
|
| +};
|
| +
|
| // A container for an external script which may be loaded and executed.
|
| //
|
| // TODO(kochi): The comment below is from pre-oilpan age and may not be correct
|
| @@ -71,7 +85,7 @@ class CORE_EXPORT PendingScript final
|
| return m_parserBlockingLoadStartTime;
|
| }
|
|
|
| - void watchForLoad(ScriptResourceClient*);
|
| + void watchForLoad(PendingScriptClient*);
|
| void stopWatchingForLoad();
|
|
|
| Element* element() const { return m_element.get(); }
|
| @@ -79,10 +93,6 @@ class CORE_EXPORT PendingScript final
|
|
|
| void setScriptResource(ScriptResource*);
|
|
|
| - void notifyFinished(Resource*) override;
|
| - String debugName() const override { return "PendingScript"; }
|
| - void notifyAppendData(ScriptResource*) override;
|
| -
|
| DECLARE_TRACE();
|
|
|
| ScriptSourceCode getSource(const KURL& documentURL,
|
| @@ -100,6 +110,12 @@ class CORE_EXPORT PendingScript final
|
| PendingScript(Element*, ScriptResource*);
|
| PendingScript() = delete;
|
|
|
| + // ScriptResourceClient
|
| + void notifyFinished(Resource*) override;
|
| + String debugName() const override { return "PendingScript"; }
|
| + void notifyAppendData(ScriptResource*) override;
|
| +
|
| + // MemoryCoordinatorClient
|
| void onMemoryStateChange(MemoryState) override;
|
|
|
| bool m_watchingForLoad;
|
| @@ -109,7 +125,7 @@ class CORE_EXPORT PendingScript final
|
| double m_parserBlockingLoadStartTime;
|
|
|
| Member<ScriptStreamer> m_streamer;
|
| - Member<ScriptResourceClient> m_client;
|
| + Member<PendingScriptClient> m_client;
|
| };
|
|
|
| } // namespace blink
|
|
|