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

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

Issue 1859763003: DocumentLoader should commit the load before creating a DocumentWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7a1df5ccd343bea28e7181b025e4d959136b7ae6..2b2a7cc83fdd248c7f846cf6cc4cdbcd3b06f0d3 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -451,15 +451,8 @@ void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over
if ((m_substituteData.isValid() && m_substituteData.forceSynchronousLoad()) || !Document::threadedParsingEnabledForTesting())
parsingPolicy = ForceSynchronousParsing;
- m_writer = createWriterFor(init, mimeType, encoding, false, parsingPolicy);
+ m_writer = createWriterFor(init, mimeType, encoding, false, parsingPolicy, overridingURL);
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);
}
@@ -660,7 +653,7 @@ void DocumentLoader::endWriting(DocumentWriter* writer)
m_writer.clear();
}
-DocumentWriter* DocumentLoader::createWriterFor(const DocumentInit& init, const AtomicString& mimeType, const AtomicString& encoding, bool dispatch, ParserSynchronizationPolicy parsingPolicy)
+DocumentWriter* DocumentLoader::createWriterFor(const DocumentInit& init, const AtomicString& mimeType, const AtomicString& encoding, bool dispatch, ParserSynchronizationPolicy parsingPolicy, const KURL& overridingURL)
{
LocalFrame* frame = init.frame();
@@ -674,6 +667,13 @@ DocumentWriter* DocumentLoader::createWriterFor(const DocumentInit& init, const
frame->loader().didBeginDocument(dispatch);
+ // This should be set before receivedFirstData().
+ if (!overridingURL.isEmpty())
+ frame->document()->setBaseURLOverride(overridingURL);
+
+ if (!dispatch)
+ frame->loader().receivedFirstData();
jochen (gone - plz use gerrit) 2016/04/20 14:23:25 this is still after didBeginDocument. Why not move
meacer 2016/04/20 23:51:00 Had to divide didBeginDocument into two: CSP and s
+
return DocumentWriter::create(document, parsingPolicy, mimeType, encoding);
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698