Commit cb63eab7 authored by kouhei@chromium.org's avatar kouhei@chromium.org

Remove state variables in PumpSession as they are no longer used.

This CL removes member variables of PumpSession, as they are no longer used.
Since r183572, all asynchronous parsing uses background thread and these
state variables were only used for deprecated asynchronous main thread parsing.

BUG=421189

Review URL: https://codereview.chromium.org/657753002

git-svn-id: svn://svn.chromium.org/blink/trunk@183728 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 59545c01
......@@ -295,16 +295,12 @@ void HTMLDocumentParser::runScriptsForPausedTreeBuilder()
m_scriptRunner->execute(scriptElement.release(), scriptStartPosition);
}
bool HTMLDocumentParser::canTakeNextToken(PumpSession& session)
bool HTMLDocumentParser::canTakeNextToken()
{
if (isStopped())
return false;
if (isWaitingForScripts()) {
// If we don't run the script, we cannot allow the next token to be taken.
if (session.needsYield)
return false;
// If we're paused waiting for a script, we try to execute scripts before continuing.
runScriptsForPausedTreeBuilder();
if (isStopped())
......@@ -587,7 +583,7 @@ void HTMLDocumentParser::pumpTokenizer()
m_xssAuditor.init(document(), &m_xssAuditorDelegate);
while (canTakeNextToken(session) && !session.needsYield) {
while (canTakeNextToken()) {
if (!isParsingFragment())
m_sourceTracker.start(m_input.current(), m_tokenizer.get(), token());
......@@ -621,9 +617,6 @@ void HTMLDocumentParser::pumpTokenizer()
m_treeBuilder->flush(FlushAlways);
RELEASE_ASSERT(!isStopped());
if (session.needsYield)
m_parserScheduler->scheduleForResume();
if (isWaitingForScripts()) {
ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState);
if (!m_preloadScanner) {
......
......@@ -150,7 +150,7 @@ private:
Document* contextForParsingSession();
bool canTakeNextToken(PumpSession&);
bool canTakeNextToken();
void pumpTokenizer();
void pumpTokenizerIfPossible();
void constructTreeFromHTMLToken(HTMLToken&);
......
......@@ -32,15 +32,6 @@
namespace blink {
// parserChunkSize is used to define how many tokens the parser will
// process before checking against parserTimeLimit and possibly yielding.
// This is a performance optimization to prevent checking after every token.
const int HTMLParserScheduler::parserChunkSize = 4096;
// parserTimeLimit is the seconds the parser will run in one write() call
// before yielding. Inline <script> execution can cause it to exceed the limit.
const double HTMLParserScheduler::parserTimeLimit = 0.2;
ActiveParserSession::ActiveParserSession(Document* document)
: m_document(document)
{
......@@ -59,13 +50,6 @@ ActiveParserSession::~ActiveParserSession()
PumpSession::PumpSession(unsigned& nestingLevel, Document* document)
: NestingLevelIncrementer(nestingLevel)
, ActiveParserSession(document)
// Setting processedTokens to INT_MAX causes us to check for yields
// after any token during any parse where yielding is allowed.
// At that time we'll initialize startTime.
, processedTokens(INT_MAX)
, startTime(0)
, needsYield(false)
, didSeeScript(false)
{
}
......
......@@ -52,11 +52,6 @@ class PumpSession : public NestingLevelIncrementer, public ActiveParserSession {
public:
PumpSession(unsigned& nestingLevel, Document*);
~PumpSession();
int processedTokens;
double startTime;
bool needsYield;
bool didSeeScript;
};
class HTMLParserScheduler {
......@@ -75,9 +70,6 @@ public:
void resume();
private:
static const double parserTimeLimit;
static const int parserChunkSize;
HTMLParserScheduler(HTMLDocumentParser*);
void continueNextChunkTimerFired(Timer<HTMLParserScheduler>*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment