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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 129813006: Move DidReceiveServerRedirectForProvisionalLoad from RenderView to RenderFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix layout test failures. Created 6 years, 11 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 | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 7adfe79445ace2bafe3760864f94fc0b1443dd3f..98f0651d0e7cd2d2ecce2ddf014b7454de3ef77a 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -154,4 +154,31 @@ void NavigatorImpl::DidFailProvisionalLoadWithError(
delegate_->DidFailProvisionalLoadWithError(render_frame_host, params);
}
+void NavigatorImpl::DidRedirectProvisionalLoad(
+ RenderFrameHostImpl* render_frame_host,
+ int32 page_id,
+ const GURL& source_url,
+ const GURL& target_url) {
+ // TODO(creis): Remove this method and have the pre-rendering code listen to
+ // WebContentsObserver::DidGetRedirectForResourceRequest instead.
+ // See http://crbug.com/78512.
+ GURL validated_source_url(source_url);
+ GURL validated_target_url(target_url);
+ RenderProcessHost* render_process_host = render_frame_host->GetProcess();
+ render_process_host->FilterURL(false, &validated_source_url);
+ render_process_host->FilterURL(false, &validated_target_url);
+ NavigationEntry* entry;
+ if (page_id == -1) {
+ entry = controller_->GetPendingEntry();
+ } else {
+ entry = controller_->GetEntryWithPageID(
+ render_frame_host->GetSiteInstance(), page_id);
+ }
+ if (!entry || entry->GetURL() != validated_source_url)
+ return;
+
+ delegate_->DidRedirectProvisionalLoad(
+ render_frame_host, validated_target_url);
+}
+
} // namespace content
« no previous file with comments | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698