Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1748)

Unified Diff: sky/engine/core/dom/DocumentParser.h

Issue 722743002: Remove dynamic cast from DocumentPaser interface (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/dom/Document.cpp ('k') | sky/engine/core/html/parser/HTMLDocumentParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/DocumentParser.h
diff --git a/sky/engine/core/dom/DocumentParser.h b/sky/engine/core/dom/DocumentParser.h
index 40baf500b8c46a1655bc979ae17ce5195c084229..af6feb5575380bf274e81996915f8d7227646964 100644
--- a/sky/engine/core/dom/DocumentParser.h
+++ b/sky/engine/core/dom/DocumentParser.h
@@ -28,6 +28,7 @@
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/RefCounted.h"
+#include "wtf/text/TextPosition.h"
namespace blink {
@@ -40,22 +41,14 @@ class DocumentParser : public RefCounted<DocumentParser> {
public:
virtual ~DocumentParser();
- virtual HTMLDocumentParser* asHTMLDocumentParser() { return 0; }
-
virtual void parse(mojo::ScopedDataPipeConsumerHandle) = 0;
- virtual bool processingData() const { return false; }
- // document() will return 0 after detach() is called.
- Document* document() const { ASSERT(m_document); return m_document; }
+ virtual TextPosition textPosition() const = 0;
+ virtual void executeScriptsWaitingForResources() = 0;
+ virtual bool isWaitingForScripts() const = 0;
+ virtual bool isExecutingScript() const = 0;
bool isParsing() const { return m_state == ParsingState; }
- bool isStopping() const { return m_state == StoppingState; }
- bool isStopped() const { return m_state >= StoppedState; }
- bool isDetached() const { return m_state == DetachedState; }
-
- // prepareToStop() is used when the EOF token is encountered and parsing is to be
- // stopped normally.
- virtual void prepareToStopParsing();
// stopParsing() is used when a load is canceled/stopped.
// stopParsing() is currently different from detach(), but shouldn't be.
@@ -74,6 +67,15 @@ public:
protected:
explicit DocumentParser(Document*);
+ // document() will return 0 after detach() is called.
+ Document* document() const { ASSERT(m_document); return m_document; }
+
+ virtual void prepareToStopParsing();
+
+ bool isStopping() const { return m_state == StoppingState; }
+ bool isStopped() const { return m_state >= StoppedState; }
+ bool isDetached() const { return m_state == DetachedState; }
+
private:
enum ParserState {
ParsingState,
« no previous file with comments | « sky/engine/core/dom/Document.cpp ('k') | sky/engine/core/html/parser/HTMLDocumentParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698