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

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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 break; 172 break;
173 case blink::WebInitialCommitInChildFrame: 173 case blink::WebInitialCommitInChildFrame:
174 UpdateForInitialLoadInChildFrame(frame, item); 174 UpdateForInitialLoadInChildFrame(frame, item);
175 break; 175 break;
176 case blink::WebHistoryInertCommit: 176 case blink::WebHistoryInertCommit:
177 // Even for inert commits (e.g., location.replace, client redirects), make 177 // Even for inert commits (e.g., location.replace, client redirects), make
178 // sure the current entry gets updated, if there is one. 178 // sure the current entry gets updated, if there is one.
179 if (current_entry_) { 179 if (current_entry_) {
180 if (HistoryEntry::HistoryNode* node = 180 if (HistoryEntry::HistoryNode* node =
181 current_entry_->GetHistoryNodeForFrame(frame)) { 181 current_entry_->GetHistoryNodeForFrame(frame)) {
182 if (!navigation_within_page)
183 node->RemoveChildren();
182 node->set_item(item); 184 node->set_item(item);
183 } 185 }
184 } 186 }
185 break; 187 break;
186 default: 188 default:
187 NOTREACHED() << "Invalid commit type: " << commit_type; 189 NOTREACHED() << "Invalid commit type: " << commit_type;
188 } 190 }
189 } 191 }
190 192
191 HistoryEntry* HistoryController::GetCurrentEntry() { 193 HistoryEntry* HistoryController::GetCurrentEntry() {
(...skipping 27 matching lines...) Expand all
219 if (!current_entry_) { 221 if (!current_entry_) {
220 current_entry_.reset( 222 current_entry_.reset(
221 new HistoryEntry(new_item, target_frame->GetRoutingID())); 223 new HistoryEntry(new_item, target_frame->GetRoutingID()));
222 } else { 224 } else {
223 current_entry_.reset(current_entry_->CloneAndReplace( 225 current_entry_.reset(current_entry_->CloneAndReplace(
224 new_item, clone_children_of_target, target_frame, render_view_)); 226 new_item, clone_children_of_target, target_frame, render_view_));
225 } 227 }
226 } 228 }
227 229
228 } // namespace content 230 } // 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