Chromium Code Reviews| Index: Source/core/html/parser/HTMLScriptRunner.h |
| diff --git a/Source/core/html/parser/HTMLScriptRunner.h b/Source/core/html/parser/HTMLScriptRunner.h |
| index e193f95facd8b6ec1aeb5349da56213151b44857..d75561ffb1cc2bd6de3f5bdc6dabace861cd53d3 100644 |
| --- a/Source/core/html/parser/HTMLScriptRunner.h |
| +++ b/Source/core/html/parser/HTMLScriptRunner.h |
| @@ -27,6 +27,8 @@ |
| #define HTMLScriptRunner_h |
| #include "core/dom/PendingScript.h" |
| +#include "core/fetch/ResourceClient.h" |
| +#include "platform/heap/Handle.h" |
| #include "wtf/Deque.h" |
| #include "wtf/PassRefPtr.h" |
| #include "wtf/text/TextPosition.h" |
| @@ -41,19 +43,19 @@ class LocalFrame; |
| class HTMLScriptRunnerHost; |
| class ScriptSourceCode; |
| -class HTMLScriptRunner { |
| - WTF_MAKE_NONCOPYABLE(HTMLScriptRunner); WTF_MAKE_FAST_ALLOCATED; |
| +class HTMLScriptRunner FINAL : public NoBaseWillBeGarbageCollectedFinalized<HTMLScriptRunner>, private ResourceClient { |
| + WTF_MAKE_NONCOPYABLE(HTMLScriptRunner); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| public: |
| - static PassOwnPtr<HTMLScriptRunner> create(Document* document, HTMLScriptRunnerHost* host) |
| + static PassOwnPtrWillBeRawPtr<HTMLScriptRunner> create(Document* document, HTMLScriptRunnerHost* host) |
| { |
| - return adoptPtr(new HTMLScriptRunner(document, host)); |
| + return adoptPtrWillBeNoop(new HTMLScriptRunner(document, host)); |
| } |
| ~HTMLScriptRunner(); |
| void detach(); |
| // Processes the passed in script and any pending scripts if possible. |
| - void execute(PassRefPtr<Element> scriptToProcess, const TextPosition& scriptStartPosition); |
| + void execute(PassRefPtrWillBeRawPtr<Element> scriptToProcess, const TextPosition& scriptStartPosition); |
| void executeScriptsWaitingForLoad(Resource*); |
| bool hasScriptsWaitingForResources() const { return m_hasScriptsWaitingForResources; } |
| @@ -63,6 +65,11 @@ public: |
| bool hasParserBlockingScript() const; |
| bool isExecutingScript() const { return !!m_scriptNestingLevel; } |
| + // ResourceClient |
| + virtual void notifyFinished(Resource*) OVERRIDE; |
| + |
| + void trace(Visitor*); |
| + |
| private: |
| HTMLScriptRunner(Document*, HTMLScriptRunnerHost*); |
| @@ -89,7 +96,7 @@ private: |
| bool isPendingScriptReady(const PendingScript&); |
| ScriptSourceCode sourceFromPendingScript(const PendingScript&, bool& errorOccurred) const; |
| - Document* m_document; |
| + RawPtrWillBeMember<Document> m_document; |
| HTMLScriptRunnerHost* m_host; |
|
haraken
2014/05/29 01:46:08
This raw pointer looks OK, but it'd be better if w
sof
2014/05/29 06:02:07
Yes, it is safe.
|
| PendingScript m_parserBlockingScript; |
| Deque<PendingScript> m_scriptsToExecuteAfterParsing; // http://www.whatwg.org/specs/web-apps/current-work/#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing |
|
haraken
2014/05/29 01:46:08
Add a FIXME to change this to a HeapDeque.
sof
2014/05/29 06:02:07
It's a non-heap version for a reason. i.e., we can
|