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

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

Issue 2461043003: Fix for the RedirectTest.ClientServerServer test. (Closed)
Patch Set: More build error fixes Created 4 years, 1 month 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 6deae0530fb5b2f39bc9336180763da458615e88..732af0b01192b0ea6807ec53602075730cca17a2 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -96,13 +96,15 @@ static bool shouldInheritSecurityOriginFromOwner(const KURL& url) {
DocumentLoader::DocumentLoader(LocalFrame* frame,
const ResourceRequest& req,
- const SubstituteData& substituteData)
+ const SubstituteData& substituteData,
+ ClientRedirectPolicy clientRedirectPolicy)
: m_frame(frame),
m_fetcher(FrameFetchContext::createContextAndFetcher(this, nullptr)),
m_originalRequest(req),
m_substituteData(substituteData),
m_request(req),
- m_isClientRedirect(false),
+ m_isClientRedirect(clientRedirectPolicy ==
+ ClientRedirectPolicy::ClientRedirect),
m_replacesCurrentHistoryItem(false),
m_dataReceived(false),
m_navigationType(NavigationTypeOther),
@@ -112,7 +114,12 @@ DocumentLoader::DocumentLoader(LocalFrame* frame,
m_wasBlockedAfterXFrameOptionsOrCSP(false),
m_state(NotStarted),
m_inDataReceived(false),
- m_dataBuffer(SharedBuffer::create()) {}
+ m_dataBuffer(SharedBuffer::create()) {
+ // The document URL needs to be added to the head of the list as that is
+ // where the redirects originated.
+ if (m_isClientRedirect)
+ appendRedirect(m_frame->document()->url());
+}
FrameLoader* DocumentLoader::frameLoader() const {
if (!m_frame)
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.h ('k') | third_party/WebKit/Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698