Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
| index 3002ac9ad7bfc93d64a921b431914a13f54c6383..6f2519c63bd2140a93f086642963a50e43aa0742 100644 |
| --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
| @@ -761,9 +761,6 @@ void HTMLDocumentParser::startBackgroundParser() |
| if (document()->loader()) |
| document()->ensureStyleResolver(); |
| - RefPtr<WeakReference<BackgroundHTMLParser>> reference = WeakReference<BackgroundHTMLParser>::createUnbound(); |
| - m_backgroundParser = WeakPtr<BackgroundHTMLParser>(reference); |
| - |
| std::unique_ptr<BackgroundHTMLParser::Configuration> config = wrapUnique(new BackgroundHTMLParser::Configuration); |
| config->options = m_options; |
| config->parser = m_weakFactory.createWeakPtr(); |
| @@ -781,15 +778,13 @@ void HTMLDocumentParser::startBackgroundParser() |
| } |
| ASSERT(config->xssAuditor->isSafeToSendToAnotherThread()); |
| - postTaskToLookaheadParser( |
| - Synchronous, |
| - &BackgroundHTMLParser::start, |
| - reference.release(), |
| - passed(std::move(config)), |
| - document()->url(), |
| - passed(CachedDocumentParameters::create(document())), |
| - MediaValuesCached::MediaValuesCachedData(*document()), |
| - passed(m_loadingTaskRunner->clone())); |
| + |
| + // The background parser is created on the main thread, but may otherwise |
| + // only be used from the parser thread. |
| + m_backgroundParser = BackgroundHTMLParser::create( |
| + std::move(config), |
| + m_loadingTaskRunner->clone()); |
| + postTaskToLookaheadParser(Synchronous, &BackgroundHTMLParser::init, m_backgroundParser, document()->url(), passed(CachedDocumentParameters::create(document())), MediaValuesCached::MediaValuesCachedData(*document())); |
|
Charlie Harrison
2016/09/01 19:25:31
This method is fine with me for now though to unbl
|
| } |
| void HTMLDocumentParser::stopBackgroundParser() |