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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 1904183002: Revert of DocumentLoader should commit the load before creating a DocumentWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: third_party/WebKit/Source/core/loader/DocumentLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index a9e58711eddba3395cba873a3c41e80cb9e7ef67..7a1df5ccd343bea28e7181b025e4d959136b7ae6 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -451,8 +451,15 @@
if ((m_substituteData.isValid() && m_substituteData.forceSynchronousLoad()) || !Document::threadedParsingEnabledForTesting())
parsingPolicy = ForceSynchronousParsing;
- m_writer = createWriterFor(init, mimeType, encoding, false, parsingPolicy, overridingURL);
+ m_writer = createWriterFor(init, mimeType, encoding, false, parsingPolicy);
m_writer->setDocumentWasLoadedAsPartOfNavigation();
+
+ // This should be set before receivedFirstData().
+ if (!overridingURL.isEmpty())
+ m_frame->document()->setBaseURLOverride(overridingURL);
+
+ // Call receivedFirstData() exactly once per load.
+ frameLoader()->receivedFirstData();
m_frame->document()->maybeHandleHttpRefresh(m_response.httpHeaderField(HTTPNames::Refresh), Document::HttpRefreshFromHeader);
}
@@ -653,7 +660,7 @@
m_writer.clear();
}
-DocumentWriter* DocumentLoader::createWriterFor(const DocumentInit& init, const AtomicString& mimeType, const AtomicString& encoding, bool dispatchWindowObjectAvailable, ParserSynchronizationPolicy parsingPolicy, const KURL& overridingURL)
+DocumentWriter* DocumentLoader::createWriterFor(const DocumentInit& init, const AtomicString& mimeType, const AtomicString& encoding, bool dispatch, ParserSynchronizationPolicy parsingPolicy)
{
LocalFrame* frame = init.frame();
@@ -665,18 +672,7 @@
Document* document = frame->localDOMWindow()->installNewDocument(mimeType, init);
- // This should be set before receivedFirstData().
- if (!overridingURL.isEmpty())
- frame->document()->setBaseURLOverride(overridingURL);
-
- frame->loader().didInstallNewDocument(dispatchWindowObjectAvailable);
-
- // This must be called before DocumentWriter is created, otherwise HTML parser
- // will use stale values from HTMLParserOption.
- if (!dispatchWindowObjectAvailable)
- frame->loader().receivedFirstData();
-
- frame->loader().didBeginDocument();
+ frame->loader().didBeginDocument(dispatch);
return DocumentWriter::create(document, parsingPolicy, mimeType, encoding);
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.h ('k') | third_party/WebKit/Source/core/loader/FrameLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698