Chromium Code Reviews| 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 1a82229fcee7ebf389cc7c099c2c214d5840658f..7bd24456f9e87470f3729ee576af57b98e93055d 100644 |
| --- a/third_party/WebKit/Source/core/dom/PendingScript.h |
| +++ b/third_party/WebKit/Source/core/dom/PendingScript.h |
| @@ -28,6 +28,7 @@ |
| #include "bindings/core/v8/ScriptStreamer.h" |
| #include "core/CoreExport.h" |
| +#include "core/dom/ScriptLoaderClient.h" |
| #include "core/loader/resource/ScriptResource.h" |
| #include "platform/MemoryCoordinator.h" |
| #include "platform/heap/Handle.h" |
| @@ -37,7 +38,6 @@ |
| namespace blink { |
| -class Element; |
| class PendingScript; |
| class ScriptSourceCode; |
| @@ -71,9 +71,9 @@ class CORE_EXPORT PendingScript final |
| public: |
| // For script from an external file. |
| - static PendingScript* create(Element*, ScriptResource*); |
| + static PendingScript* create(ScriptLoaderClient*, ScriptResource*); |
| // For inline script. |
| - static PendingScript* create(Element*, const TextPosition&); |
| + static PendingScript* create(ScriptLoaderClient*, const TextPosition&); |
| static PendingScript* createForTesting(ScriptResource*); |
| @@ -91,7 +91,7 @@ class CORE_EXPORT PendingScript final |
| void watchForLoad(PendingScriptClient*); |
| void stopWatchingForLoad(); |
| - Element* element() const; |
| + ScriptLoaderClient* scriptLoaderClient() const; |
| DECLARE_TRACE(); |
| @@ -107,7 +107,7 @@ class CORE_EXPORT PendingScript final |
| void dispose(); |
| private: |
| - PendingScript(Element*, |
| + PendingScript(ScriptLoaderClient*, |
| ScriptResource*, |
| const TextPosition&, |
| bool isForTesting = false); |
| @@ -125,9 +125,10 @@ class CORE_EXPORT PendingScript final |
| bool m_watchingForLoad; |
| - // |m_element| must points to the corresponding ScriptLoader's element and |
| - // thus must be non-null before dispose() is called (except for unit tests). |
| - Member<Element> m_element; |
| + // |m_scriptLoaderClient| must points to the corresponding ScriptLoader's |
| + // ScriptLoaderClient and thus must be non-null before dispose() is called |
| + // (except for unit tests). |
| + Member<ScriptLoaderClient> m_scriptLoaderClient; |
|
hiroshige
2017/03/01 00:58:14
Replacing Element with ScriptLoaderClient is great
|
| TextPosition m_startingPosition; // Only used for inline script tags. |
| bool m_integrityFailure; |
| @@ -136,8 +137,8 @@ class CORE_EXPORT PendingScript final |
| Member<ScriptStreamer> m_streamer; |
| Member<PendingScriptClient> m_client; |
| - // This flag is used to skip non-null checks of |m_element| in unit tests, |
| - // because |m_element| can be null in unit tests. |
| + // This flag is used to skip non-null checks of |m_scriptLoaderClient| in unit |
| + // tests, because |m_scriptLoaderClient| can be null in unit tests. |
| const bool m_isForTesting; |
| }; |