OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |