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

Unified Diff: Source/core/html/parser/HTMLDocumentParser.h

Issue 779393002: Turn DocumentParser::pinToMainThread into a cleaner api (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 | « Source/core/html/imports/HTMLImportLoader.cpp ('k') | Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLDocumentParser.h
diff --git a/Source/core/html/parser/HTMLDocumentParser.h b/Source/core/html/parser/HTMLDocumentParser.h
index 185ea60687708eaacd528ca5b16e66413116260b..81bf69d2e6a5ff9786ee263ca4caf41773559219 100644
--- a/Source/core/html/parser/HTMLDocumentParser.h
+++ b/Source/core/html/parser/HTMLDocumentParser.h
@@ -40,6 +40,7 @@
#include "core/html/parser/HTMLToken.h"
#include "core/html/parser/HTMLTokenizer.h"
#include "core/html/parser/HTMLTreeBuilderSimulator.h"
+#include "core/html/parser/ParserSynchronizationPolicy.h"
#include "core/html/parser/TextResourceDecoder.h"
#include "core/html/parser/XSSAuditor.h"
#include "core/html/parser/XSSAuditorDelegate.h"
@@ -68,9 +69,9 @@ class HTMLDocumentParser : public ScriptableDocumentParser, private HTMLScriptR
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLDocumentParser);
public:
- static PassRefPtrWillBeRawPtr<HTMLDocumentParser> create(HTMLDocument& document, bool reportErrors)
+ static PassRefPtrWillBeRawPtr<HTMLDocumentParser> create(HTMLDocument& document, bool reportErrors, ParserSynchronizationPolicy backgroundParsingPolicy)
{
- return adoptRefWillBeNoop(new HTMLDocumentParser(document, reportErrors));
+ return adoptRefWillBeNoop(new HTMLDocumentParser(document, reportErrors, backgroundParsingPolicy));
}
virtual ~HTMLDocumentParser();
virtual void trace(Visitor*) override;
@@ -112,7 +113,7 @@ protected:
virtual void append(PassRefPtr<StringImpl>) override;
virtual void finish() override final;
- HTMLDocumentParser(HTMLDocument&, bool reportErrors);
+ HTMLDocumentParser(HTMLDocument&, bool reportErrors, ParserSynchronizationPolicy);
HTMLDocumentParser(DocumentFragment*, Element* contextElement, ParserContentPolicy);
HTMLTreeBuilder* treeBuilder() const { return m_treeBuilder.get(); }
@@ -126,7 +127,6 @@ private:
}
// DocumentParser
- virtual void pinToMainThread() override final;
virtual void detach() override final;
virtual bool hasInsertionPoint() override final;
virtual bool processingData() const override final;
@@ -165,7 +165,7 @@ private:
void attemptToRunDeferredScriptsAndEnd();
void end();
- bool shouldUseThreading() const { return !m_isPinnedToMainThread; }
+ bool shouldUseThreading() const { return m_shouldUseThreading; }
bool isParsingFragment() const;
bool isScheduledForResume() const;
@@ -197,7 +197,7 @@ private:
WeakPtr<BackgroundHTMLParser> m_backgroundParser;
OwnPtrWillBeMember<HTMLResourcePreloader> m_preloader;
- bool m_isPinnedToMainThread;
+ bool m_shouldUseThreading;
bool m_endWasDelayed;
bool m_haveBackgroundParser;
bool m_tasksWereSuspended;
« no previous file with comments | « Source/core/html/imports/HTMLImportLoader.cpp ('k') | Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698