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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 743803002: Avoid stale navigation requests without excessive page id knowledge in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more saving Created 6 years 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
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 4a738e6ac1d7f07b483b88869c78425e97058adf..b6dacd17d368a85dc1ff385544619bb2ad9ffa30 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1938,28 +1938,24 @@ 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
+void WebContentsImpl::SetHistoryOffsetAndLength(int history_offset,
+ int history_length) {
+ // SetHistoryOffsetAndLength doesn't work when there are pending cross-site
Charlie Reis 2014/12/03 23:48:07 Does this matter anymore? It would be great to re
Avi (use Gerrit) 2014/12/04 21:15:16 In what way? Blink needs to know where we are in
Charlie Reis 2014/12/04 23:13:58 Sorry, I was ambiguous about "this." I meant this
Avi (use Gerrit) 2014/12/05 22:16:39 I'm not sure why this was put in. If it's about th
Charlie Reis 2014/12/05 22:51:15 Acknowledged.
// 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));
+ 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) {
@@ -4143,6 +4139,10 @@ bool WebContentsImpl::CreateRenderViewForRenderManager(
return false;
}
+ SetHistoryOffsetAndLengthForView(render_view_host,
Charlie Reis 2014/12/03 23:48:07 Interesting. We don't have a similar call here to
Avi (use Gerrit) 2014/12/04 21:15:16 Today, those values are set with the navigation, w
Charlie Reis 2014/12/04 23:13:58 I like your approach. Let's keep it.
+ 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.

Powered by Google App Engine
This is Rietveld 408576698