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

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

Issue 1811783002: Disallow was_within_same_page = true for a cross-process navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 9 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 | « no previous file | content/browser/frame_host/navigator_impl_unittest.cc » ('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 ea89de6628340945ba99d9592bb53cfa9e839739..2acedd76a19d10d8ed800441924727f0926ff8fb 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -438,6 +438,19 @@ void NavigatorImpl::DidNavigate(
bool is_navigation_within_page = controller_->IsURLInPageNavigation(
params.url, params.was_within_same_page, render_frame_host);
+
+ // If a frame claims it navigated within page, it must be the current frame,
+ // not a pending one.
+ if (is_navigation_within_page &&
+ render_frame_host !=
+ render_frame_host->frame_tree_node()
+ ->render_manager()
+ ->current_frame_host()) {
+ bad_message::ReceivedBadMessage(render_frame_host->GetProcess(),
+ bad_message::NC_IN_PAGE_NAVIGATION);
+ is_navigation_within_page = false;
+ }
+
if (ui::PageTransitionIsMainFrame(params.transition)) {
if (delegate_) {
// When overscroll navigation gesture is enabled, a screenshot of the page
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698