Chromium Code Reviews| Index: content/renderer/render_view.cc |
| diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc |
| index 972349f99357ff3f7c6cac7319e352f3c04c2599..6f3d7c99c578a8eff9014ce14eeabbfe90f42a6f 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_OffsetAndPruneHistory, |
| + OnOffsetAndPruneHistory) |
| // Have the super handle all other messages. |
| IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) |
| IPC_END_MESSAGE_MAP() |
| @@ -1017,6 +1019,22 @@ void RenderView::OnScrollFocusedEditableNodeIntoView() { |
| } |
| } |
| +void RenderView::OnOffsetAndPruneHistory(int offset) { |
| + int current_page_id = -1; |
|
tburkard
2011/08/09 17:36:03
I'd add a comment explaining what this does (eithe
cbentzel
2011/08/09 19:12:14
I did this at the ViewMsg declaration, which looke
|
| + if (history_list_offset_ >= 0) { |
|
brettw
2011/08/09 18:14:40
No {} for single-line conditionals.
cbentzel
2011/08/09 19:12:14
Done.
|
| + current_page_id = history_page_ids_[history_list_offset_]; |
| + } |
| + |
| + history_list_offset_ = offset; |
| + history_list_length_ = offset + 1; |
| + if (history_list_length_ >= 0) |
|
brettw
2011/08/09 18:14:40
What case will the history_list_length_ be negativ
cbentzel
2011/08/09 19:12:14
That would be suspicious. Removed during the migra
|
| + history_page_ids_.resize(history_list_length_, -1); |
| + // Older entries also need to be invalidated. |
| + for (int i = 0; i < history_list_offset_; ++i) |
|
brettw
2011/08/09 18:14:40
I think this version is a bit easier to follow:
/
cbentzel
2011/08/09 19:12:14
Yes, that's cleaner. Moved to that.
|
| + history_page_ids_[i] = -1; |
| + history_page_ids_[history_list_offset_] = current_page_id; |
| +} |
| + |
| /////////////////////////////////////////////////////////////////////////////// |
| // Tell the embedding application that the URL of the active page has changed |