Index: content/browser/frame_host/render_frame_host_impl.cc |
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc |
index 23c965e8b453c67623692f4e3641cc412c00674a..dde456aada68e1ffc62fd68431f957120b0f8567 100644 |
--- a/content/browser/frame_host/render_frame_host_impl.cc |
+++ b/content/browser/frame_host/render_frame_host_impl.cc |
@@ -552,8 +552,9 @@ void RenderFrameHostImpl::OnDidRedirectProvisionalLoad( |
int32 page_id, |
const GURL& source_url, |
const GURL& target_url) { |
+ CHECK_EQ(render_view_host_->page_id_, page_id); |
frame_tree_node_->navigator()->DidRedirectProvisionalLoad( |
- this, page_id, source_url, target_url); |
+ this, render_view_host_->page_id_, source_url, target_url); |
} |
// Called when the renderer navigates. For every frame loaded, we'll get this |
@@ -573,6 +574,10 @@ void RenderFrameHostImpl::OnNavigate(const IPC::Message& msg) { |
Read(&msg, &iter, &validated_params)) |
return; |
+ // Update the RVH's current page ID so that future IPCs from the renderer |
+ // correspond to the new page. |
+ render_view_host_->page_id_ = validated_params.page_id; |
+ |
// If we're waiting for a cross-site beforeunload ack from this renderer and |
// we receive a Navigate message from the main frame, then the renderer was |
// navigating already and sent it before hearing the ViewMsg_Stop message. |
@@ -885,6 +890,7 @@ void RenderFrameHostImpl::OnUpdateTitle( |
int32 page_id, |
const base::string16& title, |
blink::WebTextDirection title_direction) { |
+ CHECK_EQ(render_view_host_->page_id_, page_id); |
// This message is only sent for top-level frames. TODO(avi): when frame tree |
// mirroring works correctly, add a check here to enforce it. |
if (title.length() > kMaxTitleChars) { |
@@ -892,7 +898,7 @@ void RenderFrameHostImpl::OnUpdateTitle( |
return; |
} |
- delegate_->UpdateTitle(this, page_id, title, |
+ delegate_->UpdateTitle(this, render_view_host_->page_id_, title, |
WebTextDirectionToChromeTextDirection( |
title_direction)); |
} |