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

Unified Diff: Source/core/html/parser/BackgroundHTMLParser.cpp

Issue 876623002: Adds a CancellableTaskFactory and exposes postLoadingTasks to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 11 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 | « no previous file | Source/core/html/parser/HTMLParserScheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/BackgroundHTMLParser.cpp
diff --git a/Source/core/html/parser/BackgroundHTMLParser.cpp b/Source/core/html/parser/BackgroundHTMLParser.cpp
index 0b2d141e3020c4029dce6e62956a2517c462dd8b..69fec14ed2bd5e5cceda39876affadc273dd1c18 100644
--- a/Source/core/html/parser/BackgroundHTMLParser.cpp
+++ b/Source/core/html/parser/BackgroundHTMLParser.cpp
@@ -29,6 +29,8 @@
#include "core/html/parser/HTMLDocumentParser.h"
#include "core/html/parser/TextResourceDecoder.h"
#include "core/html/parser/XSSAuditor.h"
+#include "platform/scheduler/ClosureRunnerTask.h"
+#include "platform/scheduler/Scheduler.h"
#include "wtf/MainThread.h"
#include "wtf/text/TextPosition.h"
@@ -267,7 +269,10 @@ void BackgroundHTMLParser::sendTokensToMainThread()
chunk->tokens = m_pendingTokens.release();
chunk->startingScript = m_startingScript;
m_startingScript = false;
- callOnMainThread(bind(&HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser, m_parser, chunk.release()));
+
+ Scheduler::shared()->postLoadingTask(
+ FROM_HERE,
+ new ClosureRunnerTask(bind(&HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser, m_parser, chunk.release())));
m_pendingTokens = adoptPtr(new CompactHTMLTokenStream);
}
« no previous file with comments | « no previous file | Source/core/html/parser/HTMLParserScheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698