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

Unified Diff: content/renderer/render_view.cc

Issue 7618016: Additional fixes for prerender/instant + browsing history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
« content/common/view_messages.h ('K') | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view.cc
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index dd31fb7e922778713effed968a234cb92882269d..6b63784fd6ad99254bc8a316c7a047d596456d6b 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -1020,9 +1020,25 @@ void RenderView::OnScrollFocusedEditableNodeIntoView() {
}
}
-void RenderView::OnSetHistoryLengthAndClear(int history_length) {
+void RenderView::OnSetHistoryLengthAndClear(int history_length, int32 page_id) {
DCHECK(history_length >= 0);
+ if (page_id >= 0) {
+ // It's possible that the underlying page could have done navigation
+ // at this point, which this isn't prepared for.
+ // TODO(cbentzel): Send a message to the browser? There will be a
+ // mismatch between NavigationController and RenderView here.
+ if (page_id_ != page_id) {
Charlie Reis 2011/08/11 20:49:24 Dropping this message doesn't seem like the right
+ return;
+ }
+ } else {
+ // The prerendered page could have been swapped after the initial Navigate
+ // message is sent but prior to the commit of the provisional load being
+ // done, and sent to the browser. In that case, we can't validate so
+ // use the current one.
+ DCHECK(page_id == -1);
Charlie Reis 2011/08/11 20:49:24 I'm wondering if this whole block would be clearer
+ }
+
// history_list_length_ may be 0 if this is called between
// a navigate and a commit of the provisional load. Otherwise,
// only add one entry, regardless of how long the current history is.
« content/common/view_messages.h ('K') | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698