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

Unified Diff: content/renderer/render_view.cc

Issue 7628029: Don't ignore back navigations after max entry limit is reached. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial draft 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
« no previous file with comments | « content/renderer/render_view.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | 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..c6f39a468f7199ab643314a707a800720e41fd64 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -854,8 +854,16 @@ bool RenderView::IsBackForwardToStaleEntry(
// Check for whether this entry has been replaced with a new one.
int expected_page_id =
history_page_ids_[params.pending_history_list_offset];
- if (expected_page_id > 0 && params.page_id != expected_page_id)
- return true;
+ if (expected_page_id > 0 && params.page_id != expected_page_id) {
+ if (params.page_id < expected_page_id)
+ return true;
+
+ // Otherwise we've removed an earlier entry and should have shifted all
+ // entries left. For now, it's ok to lazily update the list.
+ // TODO(creis): Notify all live renderers when we remove entries from
+ // the front of the list, so that we don't hit this case.
+ history_page_ids_[params.pending_history_list_offset] = params.page_id;
+ }
return false;
}
« no previous file with comments | « content/renderer/render_view.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698