Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 9614814d1a2232c9a4de57e2ea6bc8ddf9385c15..ca9112af81bc56e40d79e9f6ff6dc120c11d0977 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -1943,28 +1943,18 @@ void WebContentsImpl::DetachInterstitialPage() { |
DidDetachInterstitialPage()); |
} |
-void WebContentsImpl::SetHistoryLengthAndPrune( |
- const SiteInstance* site_instance, |
- int history_length, |
- int32 minimum_page_id) { |
- // SetHistoryLengthAndPrune doesn't work when there are pending cross-site |
- // navigations. Callers should ensure that this is the case. |
- if (GetRenderManager()->pending_render_view_host()) { |
- NOTREACHED(); |
- return; |
- } |
- RenderViewHostImpl* rvh = GetRenderViewHostImpl(); |
- if (!rvh) { |
- NOTREACHED(); |
- return; |
- } |
- if (site_instance && rvh->GetSiteInstance() != site_instance) { |
- NOTREACHED(); |
- return; |
- } |
- Send(new ViewMsg_SetHistoryLengthAndPrune(GetRoutingID(), |
- history_length, |
- minimum_page_id)); |
+void WebContentsImpl::SetHistoryOffsetAndLength(int history_offset, |
+ int history_length) { |
+ SetHistoryOffsetAndLengthForView( |
+ GetRenderViewHost(), history_offset, history_length); |
+} |
+ |
+void WebContentsImpl::SetHistoryOffsetAndLengthForView( |
+ RenderViewHost* render_view_host, |
+ int history_offset, |
+ int history_length) { |
+ render_view_host->Send(new ViewMsg_SetHistoryOffsetAndLength( |
+ render_view_host->GetRoutingID(), history_offset, history_length)); |
} |
void WebContentsImpl::ReloadFocusedFrame(bool ignore_cache) { |
@@ -4148,6 +4138,10 @@ bool WebContentsImpl::CreateRenderViewForRenderManager( |
return false; |
} |
+ SetHistoryOffsetAndLengthForView(render_view_host, |
+ controller_.GetLastCommittedEntryIndex(), |
+ controller_.GetEntryCount()); |
+ |
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
// Force a ViewMsg_Resize to be sent, needed to make plugins show up on |
// linux. See crbug.com/83941. |