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

Unified Diff: WebCore/html/parser/HTMLDocumentParser.cpp

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/html/parser/HTMLDocumentParser.h ('k') | WebCore/html/parser/HTMLScriptRunner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/html/parser/HTMLDocumentParser.cpp
===================================================================
--- WebCore/html/parser/HTMLDocumentParser.cpp (revision 69799)
+++ WebCore/html/parser/HTMLDocumentParser.cpp (working copy)
@@ -142,28 +142,6 @@
m_parserScheduler.clear(); // Deleting the scheduler will clear any timers.
}
-// This kicks off "Once the user agent stops parsing" as described by:
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#the-end
-void HTMLDocumentParser::prepareToStopParsing()
-{
- ASSERT(!hasInsertionPoint());
-
- // pumpTokenizer can cause this parser to be detached from the Document,
- // but we need to ensure it isn't deleted yet.
- RefPtr<HTMLDocumentParser> protect(this);
-
- // FIXME: Set the current document readiness to "interactive".
-
- // NOTE: This pump should only ever emit buffered character tokens,
- // so ForceSynchronous vs. AllowYield should be meaningless.
- pumpTokenizerIfPossible(ForceSynchronous);
-
- DocumentParser::prepareToStopParsing();
- if (m_scriptRunner && !m_scriptRunner->executeScriptsWaitingForParsing())
- return;
- end();
-}
-
bool HTMLDocumentParser::processingData() const
{
return isScheduledForResume() || inWrite();
@@ -171,7 +149,7 @@
void HTMLDocumentParser::pumpTokenizerIfPossible(SynchronousMode mode)
{
- if (isStopped() || m_treeBuilder->isPaused())
+ if (m_parserStopped || m_treeBuilder->isPaused())
return;
// Once a resume is scheduled, HTMLParserScheduler controls when we next pump.
@@ -215,7 +193,8 @@
void HTMLDocumentParser::pumpTokenizer(SynchronousMode mode)
{
- ASSERT(!isStopped());
+ ASSERT(!isDetached());
+ ASSERT(!m_parserStopped);
ASSERT(!m_treeBuilder->isPaused());
ASSERT(!isScheduledForResume());
// ASSERT that this object is both attached to the Document and protected.
@@ -235,7 +214,7 @@
m_token.clear();
// JavaScript may have stopped or detached the parser.
- if (isStopped())
+ if (isDetached() || m_parserStopped)
return;
// The parser will pause itself when waiting on a script to load or run.
@@ -247,7 +226,7 @@
m_treeBuilder->setPaused(!shouldContinueParsing);
// JavaScript may have stopped or detached the parser.
- if (isStopped())
+ if (isDetached() || m_parserStopped)
return;
if (!shouldContinueParsing)
@@ -296,7 +275,7 @@
void HTMLDocumentParser::insert(const SegmentedString& source)
{
- if (isStopped())
+ if (m_parserStopped)
return;
// pumpTokenizer can cause this parser to be detached from the Document,
@@ -317,7 +296,7 @@
void HTMLDocumentParser::append(const SegmentedString& source)
{
- if (isStopped())
+ if (m_parserStopped)
return;
// pumpTokenizer can cause this parser to be detached from the Document,
@@ -349,6 +328,14 @@
ASSERT(!isDetached());
ASSERT(!isScheduledForResume());
+ // pumpTokenizer can cause this parser to be detached from the Document,
+ // but we need to ensure it isn't deleted yet.
+ RefPtr<HTMLDocumentParser> protect(this);
+
+ // NOTE: This pump should only ever emit buffered character tokens,
+ // so ForceSynchronous vs. AllowYield should be meaningless.
+ pumpTokenizerIfPossible(ForceSynchronous);
+
// Informs the the rest of WebCore that parsing is really finished (and deletes this).
m_treeBuilder->finished();
}
@@ -362,7 +349,7 @@
m_endWasDelayed = true;
return;
}
- prepareToStopParsing();
+ end();
}
void HTMLDocumentParser::endIfDelayed()
@@ -375,7 +362,7 @@
return;
m_endWasDelayed = false;
- prepareToStopParsing();
+ end();
}
void HTMLDocumentParser::finish()
@@ -460,11 +447,6 @@
void HTMLDocumentParser::notifyFinished(CachedResource* cachedResource)
{
- if (isStopping()) {
- prepareToStopParsing();
- return;
- }
-
// pumpTokenizer can cause this parser to be detached from the Document,
// but we need to ensure it isn't deleted yet.
RefPtr<HTMLDocumentParser> protect(this);
« no previous file with comments | « WebCore/html/parser/HTMLDocumentParser.h ('k') | WebCore/html/parser/HTMLScriptRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698