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); |
} |