Fix race between updatedocument and sendTokensToMainThread

Fixes a race that would occur if the blink scheduler wanted to
prioritize loading tasks.

BUG=510398

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

git-svn-id: svn://svn.chromium.org/blink/trunk@201308 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a2448fe4
......@@ -157,7 +157,9 @@ void BackgroundHTMLParser::updateDocument(const String& decodedData)
m_lastSeenEncodingData = encodingData;
m_xssAuditor->setEncoding(encodingData.encoding());
Platform::current()->mainThread()->postTask(FROM_HERE, threadSafeBind(&HTMLDocumentParser::didReceiveEncodingDataFromBackgroundParser, AllowCrossThreadAccess(m_parser), encodingData));
m_scheduler->postLoadingTask(
FROM_HERE,
new Task(threadSafeBind(&HTMLDocumentParser::didReceiveEncodingDataFromBackgroundParser, AllowCrossThreadAccess(m_parser), encodingData)));
}
if (decodedData.isEmpty())
......
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