summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/parser/HTMLScriptRunner.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/html/parser/HTMLScriptRunner.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/html/parser/HTMLScriptRunner.h')
-rw-r--r--Source/WebCore/html/parser/HTMLScriptRunner.h31
1 files changed, 11 insertions, 20 deletions
diff --git a/Source/WebCore/html/parser/HTMLScriptRunner.h b/Source/WebCore/html/parser/HTMLScriptRunner.h
index 45bf8d032..c86747d91 100644
--- a/Source/WebCore/html/parser/HTMLScriptRunner.h
+++ b/Source/WebCore/html/parser/HTMLScriptRunner.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,8 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HTMLScriptRunner_h
-#define HTMLScriptRunner_h
+#pragma once
#include "PendingScript.h"
#include <wtf/Deque.h>
@@ -32,16 +32,13 @@
namespace WebCore {
-class CachedResource;
-class CachedScript;
class Document;
-class Element;
class Frame;
class HTMLScriptRunnerHost;
class ScriptSourceCode;
class HTMLScriptRunner {
- WTF_MAKE_NONCOPYABLE(HTMLScriptRunner); WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_FAST_ALLOCATED;
public:
HTMLScriptRunner(Document&, HTMLScriptRunnerHost&);
~HTMLScriptRunner();
@@ -49,9 +46,9 @@ public:
void detach();
// Processes the passed in script and any pending scripts if possible.
- void execute(PassRefPtr<Element> scriptToProcess, const TextPosition& scriptStartPosition);
+ void execute(Ref<ScriptElement>&&, const TextPosition& scriptStartPosition);
- void executeScriptsWaitingForLoad(CachedResource*);
+ void executeScriptsWaitingForLoad(PendingScript&);
bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingForStylesheets; }
void executeScriptsWaitingForStylesheets();
bool executeScriptsWaitingForParsing();
@@ -62,26 +59,22 @@ public:
private:
Frame* frame() const;
- void executeParsingBlockingScript();
void executePendingScriptAndDispatchEvent(PendingScript&);
void executeParsingBlockingScripts();
- void requestParsingBlockingScript(Element*);
- void requestDeferredScript(Element*);
- bool requestPendingScript(PendingScript&, Element*) const;
+ void requestParsingBlockingScript(ScriptElement&);
+ void requestDeferredScript(ScriptElement&);
- void runScript(Element*, const TextPosition& scriptStartPosition);
+ void runScript(ScriptElement&, const TextPosition& scriptStartPosition);
- // Helpers for dealing with HTMLScriptRunnerHost
void watchForLoad(PendingScript&);
void stopWatchingForLoad(PendingScript&);
bool isPendingScriptReady(const PendingScript&);
- ScriptSourceCode sourceFromPendingScript(const PendingScript&, bool& errorOccurred) const;
Document* m_document;
HTMLScriptRunnerHost& m_host;
- 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
+ RefPtr<PendingScript> m_parserBlockingScript;
+ Deque<Ref<PendingScript>> m_scriptsToExecuteAfterParsing; // http://www.whatwg.org/specs/web-apps/current-work/#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing
unsigned m_scriptNestingLevel;
// We only want stylesheet loads to trigger script execution if script
@@ -91,6 +84,4 @@ private:
bool m_hasScriptsWaitingForStylesheets;
};
-}
-
-#endif
+} // namespace WebCore