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

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: Created 5 years, 7 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 | « no previous file | content/renderer/history_entry.h » ('j') | content/renderer/history_entry.h » ('J')
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if (HistoryEntry::HistoryNode* node = 212 if (HistoryEntry::HistoryNode* node =
213 provisional_entry_->GetHistoryNodeForFrame(frame)) 213 provisional_entry_->GetHistoryNodeForFrame(frame))
214 node->RemoveChildren(); 214 node->RemoveChildren();
215 } 215 }
216 216
217 void HistoryController::CreateNewBackForwardItem( 217 void HistoryController::CreateNewBackForwardItem(
218 RenderFrameImpl* target_frame, 218 RenderFrameImpl* target_frame,
219 const WebHistoryItem& new_item, 219 const WebHistoryItem& new_item,
220 bool clone_children_of_target) { 220 bool clone_children_of_target) {
221 if (!current_entry_) { 221 if (!current_entry_) {
222 current_entry_.reset( 222 current_entry_.reset(new HistoryEntry(new_item));
223 new HistoryEntry(new_item, target_frame->GetRoutingID()));
224 } else { 223 } else {
225 current_entry_.reset(current_entry_->CloneAndReplace( 224 current_entry_.reset(current_entry_->CloneAndReplace(
226 new_item, clone_children_of_target, target_frame, render_view_)); 225 new_item, clone_children_of_target, target_frame, render_view_));
227 } 226 }
228 } 227 }
229 228
230 } // namespace content 229 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/history_entry.h » ('j') | content/renderer/history_entry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698