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

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

Issue 2196333002: PlzNavigate: Clear provisional history item on redirects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@timing_api
Patch Set: Rebasing again, Trybot issues. Created 4 years, 4 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 0305c0b8b8b27219d3eb1d3b55e03ba0faa0bda8..ca806956f07c04dbddaccb752382393fb919a023 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -209,6 +209,18 @@ Resource* DocumentLoader::startPreload(Resource::Type type, FetchRequest& reques
return resource;
}
+void DocumentLoader::didRedirect(const KURL& oldURL, const KURL& newURL)
+{
+ timing().addRedirect(oldURL, newURL);
+
+ // If a redirection happens during a back/forward navigation, don't restore
+ // any state from the old HistoryItem.
+ // There is a provisional history item for back/forward navigation only.
+ // In the other case, clearing it is a no-op.
+ DCHECK(frameLoader());
+ frameLoader()->clearProvisionalHistoryItem();
+}
+
void DocumentLoader::dispatchLinkHeaderPreloads(ViewportDescriptionWrapper* viewport, LinkLoader::MediaPreloadPolicy mediaPolicy)
{
LinkLoader::loadLinksFromHeader(response().httpHeaderField(HTTPNames::Link), response().url(), m_frame->document(), NetworkHintsInterfaceImpl(), LinkLoader::OnlyLoadResources, mediaPolicy, viewport);
@@ -329,9 +341,9 @@ void DocumentLoader::redirectReceived(Resource* resource, ResourceRequest& reque
}
ASSERT(timing().fetchStart());
- timing().addRedirect(redirectResponse.url(), requestURL);
appendRedirect(requestURL);
- frameLoader()->receivedMainResourceRedirect(requestURL);
+ didRedirect(redirectResponse.url(), requestURL);
+ frameLoader()->client()->dispatchDidReceiveServerRedirectForProvisionalLoad();
}
static bool canShowMIMEType(const String& mimeType, LocalFrame* frame)
« 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