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

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

Issue 1354363002: Cleanup: Pass std::string as const reference from content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 : entry_(entry) { 110 : entry_(entry) {
111 if (!item.isNull()) 111 if (!item.isNull())
112 set_item(item); 112 set_item(item);
113 children_.reset(new ScopedVector<HistoryNode>); 113 children_.reset(new ScopedVector<HistoryNode>);
114 } 114 }
115 115
116 HistoryEntry::HistoryNode::~HistoryNode() { 116 HistoryEntry::HistoryNode::~HistoryNode() {
117 if (!entry_ || item_.isNull()) 117 if (!entry_ || item_.isNull())
118 return; 118 return;
119 119
120 for (std::string name : unique_names_) { 120 for (const std::string& name : unique_names_) {
121 if (entry_->unique_names_to_items_[name] == this) 121 if (entry_->unique_names_to_items_[name] == this)
122 entry_->unique_names_to_items_.erase(name); 122 entry_->unique_names_to_items_.erase(name);
123 } 123 }
124 } 124 }
125 125
126 void HistoryEntry::HistoryNode::RemoveChildren() { 126 void HistoryEntry::HistoryNode::RemoveChildren() {
127 children_.reset(new ScopedVector<HistoryNode>); 127 children_.reset(new ScopedVector<HistoryNode>);
128 } 128 }
129 129
130 HistoryEntry::HistoryEntry() : weak_ptr_factory_(this) { 130 HistoryEntry::HistoryEntry() : weak_ptr_factory_(this) {
(...skipping 28 matching lines...) Expand all
159 return unique_names_to_items_[frame->GetWebFrame()->uniqueName().utf8()]; 159 return unique_names_to_items_[frame->GetWebFrame()->uniqueName().utf8()];
160 } 160 }
161 161
162 WebHistoryItem HistoryEntry::GetItemForFrame(RenderFrameImpl* frame) { 162 WebHistoryItem HistoryEntry::GetItemForFrame(RenderFrameImpl* frame) {
163 if (HistoryNode* history_node = GetHistoryNodeForFrame(frame)) 163 if (HistoryNode* history_node = GetHistoryNodeForFrame(frame))
164 return history_node->item(); 164 return history_node->item();
165 return WebHistoryItem(); 165 return WebHistoryItem();
166 } 166 }
167 167
168 } // namespace content 168 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/content_browser_test_utils.cc ('k') | content/renderer/media/rtc_peer_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698