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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 RenderFrameImpl* current_frame) { | 62 RenderFrameImpl* current_frame) { |
63 bool is_target_frame = target_frame == current_frame; | 63 bool is_target_frame = target_frame == current_frame; |
64 const WebHistoryItem& item_for_create = is_target_frame ? new_item : item_; | 64 const WebHistoryItem& item_for_create = is_target_frame ? new_item : item_; |
65 HistoryNode* new_history_node = new HistoryNode(new_entry, item_for_create); | 65 HistoryNode* new_history_node = new HistoryNode(new_entry, item_for_create); |
66 | 66 |
67 if (is_target_frame && clone_children_of_target && !item_.isNull()) { | 67 if (is_target_frame && clone_children_of_target && !item_.isNull()) { |
68 new_history_node->item().setDocumentSequenceNumber( | 68 new_history_node->item().setDocumentSequenceNumber( |
69 item_.documentSequenceNumber()); | 69 item_.documentSequenceNumber()); |
70 } | 70 } |
71 | 71 |
72 if (clone_children_of_target || !is_target_frame) { | 72 if (current_frame && (clone_children_of_target || !is_target_frame)) { |
Charlie Reis
2015/06/04 00:02:11
Hmm. I suppose this is needed for OOPIFs, but it
nasko
2015/06/04 14:57:13
This is the one I wasn't really sure how it needs
Charlie Reis
2015/06/04 22:27:31
It's beyond what I've considered so far, but proba
nasko
2015/06/04 23:38:36
Acknowledged.
| |
73 for (WebFrame* child = current_frame->GetWebFrame()->firstChild(); child; | 73 for (WebFrame* child = current_frame->GetWebFrame()->firstChild(); child; |
74 child = child->nextSibling()) { | 74 child = child->nextSibling()) { |
75 RenderFrameImpl* child_render_frame = | 75 RenderFrameImpl* child_render_frame = |
76 RenderFrameImpl::FromWebFrame(child); | 76 RenderFrameImpl::FromWebFrame(child); |
77 // TODO(creis): A child frame may be a RenderFrameProxy. We should still | 77 // TODO(creis): A child frame may be a RenderFrameProxy. We should still |
78 // process its children, but that will be possible when we move this code | 78 // process its children, but that will be possible when we move this code |
79 // to the browser process in https://crbug.com/236848. | 79 // to the browser process in https://crbug.com/236848. |
80 if (!child_render_frame) | 80 if (!child_render_frame) |
81 continue; | 81 continue; |
82 HistoryNode* child_history_node = | 82 HistoryNode* child_history_node = |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 return unique_names_to_items_[frame->GetWebFrame()->uniqueName().utf8()]; | 156 return unique_names_to_items_[frame->GetWebFrame()->uniqueName().utf8()]; |
157 } | 157 } |
158 | 158 |
159 WebHistoryItem HistoryEntry::GetItemForFrame(RenderFrameImpl* frame) { | 159 WebHistoryItem HistoryEntry::GetItemForFrame(RenderFrameImpl* frame) { |
160 if (HistoryNode* history_node = GetHistoryNodeForFrame(frame)) | 160 if (HistoryNode* history_node = GetHistoryNodeForFrame(frame)) |
161 return history_node->item(); | 161 return history_node->item(); |
162 return WebHistoryItem(); | 162 return WebHistoryItem(); |
163 } | 163 } |
164 | 164 |
165 } // namespace content | 165 } // namespace content |
OLD | NEW |