Chromium Code Reviews| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 | 314 |
| 315 void FrameTreeNode::SetPendingSandboxFlags( | 315 void FrameTreeNode::SetPendingSandboxFlags( |
| 316 blink::WebSandboxFlags sandbox_flags) { | 316 blink::WebSandboxFlags sandbox_flags) { |
| 317 pending_sandbox_flags_ = sandbox_flags; | 317 pending_sandbox_flags_ = sandbox_flags; |
| 318 | 318 |
| 319 // Subframes should always inherit their parent's sandbox flags. | 319 // Subframes should always inherit their parent's sandbox flags. |
| 320 if (parent()) | 320 if (parent()) |
| 321 pending_sandbox_flags_ |= parent()->effective_sandbox_flags(); | 321 pending_sandbox_flags_ |= parent()->effective_sandbox_flags(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 void FrameTreeNode::SetPendingContainerPolicy( | |
| 325 const ParsedFeaturePolicyHeader& container_policy) { | |
| 326 pending_container_policy_ = container_policy; | |
| 327 } | |
| 328 | |
| 324 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { | 329 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { |
| 325 if (!other || !other->child_count()) | 330 if (!other || !other->child_count()) |
| 326 return false; | 331 return false; |
| 327 | 332 |
| 328 for (FrameTreeNode* node = parent(); node; node = node->parent()) { | 333 for (FrameTreeNode* node = parent(); node; node = node->parent()) { |
| 329 if (node == other) | 334 if (node == other) |
| 330 return true; | 335 return true; |
| 331 } | 336 } |
| 332 | 337 |
| 333 return false; | 338 return false; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 357 render_manager_.speculative_frame_host(); | 362 render_manager_.speculative_frame_host(); |
| 358 if (speculative_frame_host && speculative_frame_host->is_loading()) | 363 if (speculative_frame_host && speculative_frame_host->is_loading()) |
| 359 return true; | 364 return true; |
| 360 } else { | 365 } else { |
| 361 if (pending_frame_host && pending_frame_host->is_loading()) | 366 if (pending_frame_host && pending_frame_host->is_loading()) |
| 362 return true; | 367 return true; |
| 363 } | 368 } |
| 364 return current_frame_host->is_loading(); | 369 return current_frame_host->is_loading(); |
| 365 } | 370 } |
| 366 | 371 |
| 367 bool FrameTreeNode::CommitPendingSandboxFlags() { | 372 bool FrameTreeNode::CommitPendingFramePolicy() { |
| 368 bool did_change_flags = | 373 bool did_change_flags = |
|
lunalu1
2017/04/05 22:30:03
nit: s/did_change_flags/did_change_frame_policy/
iclelland
2017/04/09 03:25:54
Separated into two appropriately-named flags inste
| |
| 369 pending_sandbox_flags_ != replication_state_.sandbox_flags; | 374 pending_sandbox_flags_ != replication_state_.sandbox_flags || |
| 375 pending_container_policy_ != replication_state_.container_policy; | |
|
lunalu1
2017/04/05 22:30:03
container policy is a white-list (WebVector<WebPar
iclelland
2017/04/11 17:41:43
We don't need to, in that case, but in practice th
| |
| 370 replication_state_.sandbox_flags = pending_sandbox_flags_; | 376 replication_state_.sandbox_flags = pending_sandbox_flags_; |
|
lunalu1
2017/04/05 22:30:03
We don't need to reassign the value, unless the va
iclelland
2017/04/09 03:25:54
Done.
| |
| 377 replication_state_.container_policy = pending_container_policy_; | |
| 371 return did_change_flags; | 378 return did_change_flags; |
| 372 } | 379 } |
| 373 | 380 |
| 374 void FrameTreeNode::CreatedNavigationRequest( | 381 void FrameTreeNode::CreatedNavigationRequest( |
| 375 std::unique_ptr<NavigationRequest> navigation_request) { | 382 std::unique_ptr<NavigationRequest> navigation_request) { |
| 376 CHECK(IsBrowserSideNavigationEnabled()); | 383 CHECK(IsBrowserSideNavigationEnabled()); |
| 377 | 384 |
| 378 // This is never called when navigating to a Javascript URL. For the loading | 385 // This is never called when navigating to a Javascript URL. For the loading |
| 379 // state, this matches what Blink is doing: Blink doesn't send throbber | 386 // state, this matches what Blink is doing: Blink doesn't send throbber |
| 380 // notifications for Javascript URLS. | 387 // notifications for Javascript URLS. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 573 } | 580 } |
| 574 return parent_->child_at(i + relative_offset); | 581 return parent_->child_at(i + relative_offset); |
| 575 } | 582 } |
| 576 } | 583 } |
| 577 | 584 |
| 578 NOTREACHED() << "FrameTreeNode not found in its parent's children."; | 585 NOTREACHED() << "FrameTreeNode not found in its parent's children."; |
| 579 return nullptr; | 586 return nullptr; |
| 580 } | 587 } |
| 581 | 588 |
| 582 } // namespace content | 589 } // namespace content |
| OLD | NEW |