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 |