| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/frame_host/frame_tree_node.h" | 5 #include "content/browser/frame_host/frame_tree_node.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // observers are notified of its deletion. | 195 // observers are notified of its deletion. |
| 196 std::unique_ptr<FrameTreeNode> node_to_delete(std::move(*iter)); | 196 std::unique_ptr<FrameTreeNode> node_to_delete(std::move(*iter)); |
| 197 children_.erase(iter); | 197 children_.erase(iter); |
| 198 node_to_delete.reset(); | 198 node_to_delete.reset(); |
| 199 return; | 199 return; |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 void FrameTreeNode::ResetForNewProcess() { | 204 void FrameTreeNode::ResetForNewProcess() { |
| 205 current_frame_host()->set_last_committed_url(GURL()); | 205 current_frame_host()->SetLastCommittedUrl(GURL()); |
| 206 blame_context_.TakeSnapshot(); | 206 blame_context_.TakeSnapshot(); |
| 207 | 207 |
| 208 // Remove child nodes from the tree, then delete them. This destruction | 208 // Remove child nodes from the tree, then delete them. This destruction |
| 209 // operation will notify observers. | 209 // operation will notify observers. |
| 210 std::vector<std::unique_ptr<FrameTreeNode>>().swap(children_); | 210 std::vector<std::unique_ptr<FrameTreeNode>>().swap(children_); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void FrameTreeNode::SetOpener(FrameTreeNode* opener) { | 213 void FrameTreeNode::SetOpener(FrameTreeNode* opener) { |
| 214 if (opener_) { | 214 if (opener_) { |
| 215 opener_->RemoveObserver(opener_observer_.get()); | 215 opener_->RemoveObserver(opener_observer_.get()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 235 DCHECK(!original_opener_observer_); | 235 DCHECK(!original_opener_observer_); |
| 236 original_opener_observer_ = | 236 original_opener_observer_ = |
| 237 base::MakeUnique<OpenerDestroyedObserver>(this, true); | 237 base::MakeUnique<OpenerDestroyedObserver>(this, true); |
| 238 original_opener_->AddObserver(original_opener_observer_.get()); | 238 original_opener_->AddObserver(original_opener_observer_.get()); |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 | 241 |
| 242 void FrameTreeNode::SetCurrentURL(const GURL& url) { | 242 void FrameTreeNode::SetCurrentURL(const GURL& url) { |
| 243 if (!has_committed_real_load_ && url != url::kAboutBlankURL) | 243 if (!has_committed_real_load_ && url != url::kAboutBlankURL) |
| 244 has_committed_real_load_ = true; | 244 has_committed_real_load_ = true; |
| 245 current_frame_host()->set_last_committed_url(url); | 245 current_frame_host()->SetLastCommittedUrl(url); |
| 246 blame_context_.TakeSnapshot(); | 246 blame_context_.TakeSnapshot(); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void FrameTreeNode::SetCurrentOrigin( | 249 void FrameTreeNode::SetCurrentOrigin( |
| 250 const url::Origin& origin, | 250 const url::Origin& origin, |
| 251 bool is_potentially_trustworthy_unique_origin) { | 251 bool is_potentially_trustworthy_unique_origin) { |
| 252 if (!origin.IsSameOriginWith(replication_state_.origin) || | 252 if (!origin.IsSameOriginWith(replication_state_.origin) || |
| 253 replication_state_.has_potentially_trustworthy_unique_origin != | 253 replication_state_.has_potentially_trustworthy_unique_origin != |
| 254 is_potentially_trustworthy_unique_origin) { | 254 is_potentially_trustworthy_unique_origin) { |
| 255 render_manager_.OnDidUpdateOrigin(origin, | 255 render_manager_.OnDidUpdateOrigin(origin, |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 } | 566 } |
| 567 return parent_->child_at(i + relative_offset); | 567 return parent_->child_at(i + relative_offset); |
| 568 } | 568 } |
| 569 } | 569 } |
| 570 | 570 |
| 571 NOTREACHED() << "FrameTreeNode not found in its parent's children."; | 571 NOTREACHED() << "FrameTreeNode not found in its parent's children."; |
| 572 return nullptr; | 572 return nullptr; |
| 573 } | 573 } |
| 574 | 574 |
| 575 } // namespace content | 575 } // namespace content |
| OLD | NEW |