| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 is_potentially_trustworthy_unique_origin; | 225 is_potentially_trustworthy_unique_origin; |
| 226 } | 226 } |
| 227 | 227 |
| 228 void FrameTreeNode::SetFrameName(const std::string& name, | 228 void FrameTreeNode::SetFrameName(const std::string& name, |
| 229 const std::string& unique_name) { | 229 const std::string& unique_name) { |
| 230 if (name == replication_state_.name) { | 230 if (name == replication_state_.name) { |
| 231 // |unique_name| shouldn't change unless |name| changes. | 231 // |unique_name| shouldn't change unless |name| changes. |
| 232 DCHECK_EQ(unique_name, replication_state_.unique_name); | 232 DCHECK_EQ(unique_name, replication_state_.unique_name); |
| 233 return; | 233 return; |
| 234 } | 234 } |
| 235 |
| 236 if (parent()) { |
| 237 // Non-main frames should have a non-empty unique name. |
| 238 DCHECK(!unique_name.empty()); |
| 239 } else { |
| 240 // Unique name of main frames should always stay empty. |
| 241 DCHECK(unique_name.empty()); |
| 242 } |
| 243 |
| 235 RecordUniqueNameLength(unique_name.size()); | 244 RecordUniqueNameLength(unique_name.size()); |
| 236 render_manager_.OnDidUpdateName(name, unique_name); | 245 render_manager_.OnDidUpdateName(name, unique_name); |
| 237 replication_state_.name = name; | 246 replication_state_.name = name; |
| 238 replication_state_.unique_name = unique_name; | 247 replication_state_.unique_name = unique_name; |
| 239 } | 248 } |
| 240 | 249 |
| 241 void FrameTreeNode::AddContentSecurityPolicy( | 250 void FrameTreeNode::AddContentSecurityPolicy( |
| 242 const ContentSecurityPolicyHeader& header) { | 251 const ContentSecurityPolicyHeader& header) { |
| 243 replication_state_.accumulated_csp_headers.push_back(header); | 252 replication_state_.accumulated_csp_headers.push_back(header); |
| 244 render_manager_.OnDidAddContentSecurityPolicy(header); | 253 render_manager_.OnDidAddContentSecurityPolicy(header); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 } | 503 } |
| 495 return parent_->child_at(i + relative_offset); | 504 return parent_->child_at(i + relative_offset); |
| 496 } | 505 } |
| 497 } | 506 } |
| 498 | 507 |
| 499 NOTREACHED() << "FrameTreeNode not found in its parent's children."; | 508 NOTREACHED() << "FrameTreeNode not found in its parent's children."; |
| 500 return nullptr; | 509 return nullptr; |
| 501 } | 510 } |
| 502 | 511 |
| 503 } // namespace content | 512 } // namespace content |
| OLD | NEW |