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

Unified Diff: WebCore/dom/DocumentParser.h

Issue 3776004: Revert 66670 - 2010-09-01 Tony Gentilcore <tonyg@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 2 months 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 | « WebCore/dom/Document.cpp ('k') | WebCore/dom/DocumentParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/dom/DocumentParser.h
===================================================================
--- WebCore/dom/DocumentParser.h (revision 69799)
+++ WebCore/dom/DocumentParser.h (working copy)
@@ -57,30 +57,13 @@
// FIXME: processingData() is only used by DocumentLoader::isLoadingInAPISense
// and is very unclear as to what it actually means. The LegacyHTMLDocumentParser
- // used to implement it.
+ // used to implements it.
virtual bool processingData() const { return false; }
// document() will return 0 after detach() is called.
Document* document() const { ASSERT(m_document); return m_document; }
+ bool isDetached() const { return !m_document; }
- 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; }
-
- // FIXME: Is this necessary? Does XMLDocumentParserLibxml2 really need to set this?
- virtual void startParsing();
-
- // 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.
- // It should NOT be ok to call any methods on DocumentParser after either
- // detach() or stopParsing() but right now only detach() will ASSERT.
- virtual void stopParsing();
-
// Document is expected to detach the parser before releasing its ref.
// After detach, m_document is cleared. The parser will unwind its
// callstacks, but not produce any more nodes.
@@ -88,18 +71,22 @@
// detach is called.
virtual void detach();
+ // stopParsing() is used when a load is canceled/stopped.
+ // stopParsing() is currently different from detach(), but shouldn't be.
+ // It should NOT be ok to call any methods on DocumentParser after either
+ // detach() or stopParsing() but right now only detach() will ASSERT.
+ virtual void stopParsing() { m_parserStopped = true; }
+
protected:
DocumentParser(Document*);
-private:
- enum ParserState {
- ParsingState,
- StoppingState,
- StoppedState,
- DetachedState
- };
- ParserState m_state;
+ // The parser has buffers, so parsing may continue even after
+ // it stops receiving data. We use m_parserStopped to stop the parser
+ // even when it has buffered data.
+ // FIXME: m_document = 0 could be changed to mean "parser stopped".
+ bool m_parserStopped;
+private:
// Every DocumentParser needs a pointer back to the document.
// m_document will be 0 after the parser is stopped.
Document* m_document;
« no previous file with comments | « WebCore/dom/Document.cpp ('k') | WebCore/dom/DocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698