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

Side by Side Diff: content/renderer/history_controller.cc

Issue 1138543002: Better remove HistoryNodes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove frame sequence numbers from serialization Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « content/common/page_state_serialization_unittest.cc ('k') | content/renderer/history_entry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /* 5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 current_entry_->GetHistoryNodeForFrame(frame)) { 146 current_entry_->GetHistoryNodeForFrame(frame)) {
147 existing_node->set_item(item); 147 existing_node->set_item(item);
148 return; 148 return;
149 } 149 }
150 RenderFrameImpl* parent = 150 RenderFrameImpl* parent =
151 RenderFrameImpl::FromWebFrame(frame->GetWebFrame()->parent()); 151 RenderFrameImpl::FromWebFrame(frame->GetWebFrame()->parent());
152 if (!parent) 152 if (!parent)
153 return; 153 return;
154 if (HistoryEntry::HistoryNode* parent_history_node = 154 if (HistoryEntry::HistoryNode* parent_history_node =
155 current_entry_->GetHistoryNodeForFrame(parent)) { 155 current_entry_->GetHistoryNodeForFrame(parent)) {
156 parent_history_node->AddChild(item, frame->GetRoutingID()); 156 parent_history_node->AddChild(item);
157 } 157 }
158 } 158 }
159 159
160 void HistoryController::UpdateForCommit(RenderFrameImpl* frame, 160 void HistoryController::UpdateForCommit(RenderFrameImpl* frame,
161 const WebHistoryItem& item, 161 const WebHistoryItem& item,
162 WebHistoryCommitType commit_type, 162 WebHistoryCommitType commit_type,
163 bool navigation_within_page) { 163 bool navigation_within_page) {
164 switch (commit_type) { 164 switch (commit_type) {
165 case blink::WebBackForwardCommit: 165 case blink::WebBackForwardCommit:
166 if (!provisional_entry_) 166 if (!provisional_entry_)
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (HistoryEntry::HistoryNode* node = 210 if (HistoryEntry::HistoryNode* node =
211 provisional_entry_->GetHistoryNodeForFrame(frame)) 211 provisional_entry_->GetHistoryNodeForFrame(frame))
212 node->RemoveChildren(); 212 node->RemoveChildren();
213 } 213 }
214 214
215 void HistoryController::CreateNewBackForwardItem( 215 void HistoryController::CreateNewBackForwardItem(
216 RenderFrameImpl* target_frame, 216 RenderFrameImpl* target_frame,
217 const WebHistoryItem& new_item, 217 const WebHistoryItem& new_item,
218 bool clone_children_of_target) { 218 bool clone_children_of_target) {
219 if (!current_entry_) { 219 if (!current_entry_) {
220 current_entry_.reset( 220 current_entry_.reset(new HistoryEntry(new_item));
221 new HistoryEntry(new_item, target_frame->GetRoutingID()));
222 } else { 221 } else {
223 current_entry_.reset(current_entry_->CloneAndReplace( 222 current_entry_.reset(current_entry_->CloneAndReplace(
224 new_item, clone_children_of_target, target_frame, render_view_)); 223 new_item, clone_children_of_target, target_frame, render_view_));
225 } 224 }
226 } 225 }
227 226
228 } // namespace content 227 } // namespace content
OLDNEW
« no previous file with comments | « content/common/page_state_serialization_unittest.cc ('k') | content/renderer/history_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698