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

Unified Diff: content/renderer/render_view.cc

Issue 7491096: Fix regression with back-button not working on prerendered and instant pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment change 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 972349f99357ff3f7c6cac7319e352f3c04c2599..b5b5fd6323c268c04eb3ab5a20d50cb3bb5a4c50 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -703,6 +703,8 @@ bool RenderView::OnMessageReceived(const IPC::Message& message) {
#endif
IPC_MESSAGE_HANDLER(ViewMsg_UpdateRemoteAccessClientFirewallTraversal,
OnUpdateRemoteAccessClientFirewallTraversal)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndClear,
+ OnSetHistoryLengthAndClear)
// Have the super handle all other messages.
IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message))
IPC_END_MESSAGE_MAP()
@@ -1017,6 +1019,21 @@ void RenderView::OnScrollFocusedEditableNodeIntoView() {
}
}
+void RenderView::OnSetHistoryLengthAndClear(int history_length) {
+ DCHECK(history_length >= 0);
+ DCHECK(history_list_length_ == 0 || history_list_length_ == 1);
Charlie Reis 2011/08/09 20:59:31 Should we return early if this isn't the case? Re
cbentzel 2011/08/09 21:21:12 Yes. Changed to returning early.
+ int current_page_id = -1;
Charlie Reis 2011/08/09 20:59:31 I think the page_id_ field should be the same thin
+ if (history_list_offset_ >= 0)
+ current_page_id = history_page_ids_[history_list_offset_];
+ int new_history_list_length = history_length + history_list_length_;
Charlie Reis 2011/08/09 20:59:31 Why are we adding the two? It sounds like we're s
cbentzel 2011/08/09 21:21:12 The prerendered page could be swapped in between t
+ std::vector<int32> new_history_page_ids_(new_history_list_length, -1);
+ if (current_page_id != -1)
+ new_history_page_ids_[new_history_list_length - 1] = current_page_id;
+ new_history_page_ids_.swap(history_page_ids_);
+ history_list_offset_ = new_history_list_length - 1;
+ history_list_length_ = new_history_list_length;
+}
+
///////////////////////////////////////////////////////////////////////////////
// Tell the embedding application that the URL of the active page has changed
« 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