| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 frame_tree_node_id_(next_frame_tree_node_id_++), | 91 frame_tree_node_id_(next_frame_tree_node_id_++), |
| 92 parent_(NULL), | 92 parent_(NULL), |
| 93 opener_(nullptr), | 93 opener_(nullptr), |
| 94 opener_observer_(nullptr), | 94 opener_observer_(nullptr), |
| 95 has_committed_real_load_(false), | 95 has_committed_real_load_(false), |
| 96 replication_state_( | 96 replication_state_( |
| 97 scope, | 97 scope, |
| 98 name, | 98 name, |
| 99 unique_name, | 99 unique_name, |
| 100 blink::WebSandboxFlags::None, | 100 blink::WebSandboxFlags::None, |
| 101 false /* should enforce strict mixed content checking */), | 101 false /* should enforce strict mixed content checking */, |
| 102 false /* is a potentially trustworthy unique origin */), |
| 102 pending_sandbox_flags_(blink::WebSandboxFlags::None), | 103 pending_sandbox_flags_(blink::WebSandboxFlags::None), |
| 103 frame_owner_properties_(frame_owner_properties), | 104 frame_owner_properties_(frame_owner_properties), |
| 104 loading_progress_(kLoadingProgressNotStarted) { | 105 loading_progress_(kLoadingProgressNotStarted) { |
| 105 std::pair<FrameTreeNodeIdMap::iterator, bool> result = | 106 std::pair<FrameTreeNodeIdMap::iterator, bool> result = |
| 106 g_frame_tree_node_id_map.Get().insert( | 107 g_frame_tree_node_id_map.Get().insert( |
| 107 std::make_pair(frame_tree_node_id_, this)); | 108 std::make_pair(frame_tree_node_id_, this)); |
| 108 CHECK(result.second); | 109 CHECK(result.second); |
| 109 | 110 |
| 110 TRACE_EVENT_OBJECT_CREATED_WITH_ID( | 111 TRACE_EVENT_OBJECT_CREATED_WITH_ID( |
| 111 "navigation", "FrameTreeNode", | 112 "navigation", "FrameTreeNode", |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 void FrameTreeNode::SetEnforceStrictMixedContentChecking(bool should_enforce) { | 235 void FrameTreeNode::SetEnforceStrictMixedContentChecking(bool should_enforce) { |
| 235 if (should_enforce == | 236 if (should_enforce == |
| 236 replication_state_.should_enforce_strict_mixed_content_checking) { | 237 replication_state_.should_enforce_strict_mixed_content_checking) { |
| 237 return; | 238 return; |
| 238 } | 239 } |
| 239 render_manager_.OnEnforceStrictMixedContentChecking(should_enforce); | 240 render_manager_.OnEnforceStrictMixedContentChecking(should_enforce); |
| 240 replication_state_.should_enforce_strict_mixed_content_checking = | 241 replication_state_.should_enforce_strict_mixed_content_checking = |
| 241 should_enforce; | 242 should_enforce; |
| 242 } | 243 } |
| 243 | 244 |
| 245 void FrameTreeNode::SetUniqueOriginPotentiallyTrustworthy( |
| 246 bool is_unique_origin_potentially_trustworthy) { |
| 247 if (replication_state_.is_potentially_trustworthy_unique_origin == |
| 248 is_unique_origin_potentially_trustworthy) { |
| 249 return; |
| 250 } |
| 251 render_manager_.OnSetUniqueOriginPotentiallyTrustworthy( |
| 252 is_unique_origin_potentially_trustworthy); |
| 253 replication_state_.is_potentially_trustworthy_unique_origin = |
| 254 is_unique_origin_potentially_trustworthy; |
| 255 } |
| 256 |
| 244 void FrameTreeNode::SetPendingSandboxFlags( | 257 void FrameTreeNode::SetPendingSandboxFlags( |
| 245 blink::WebSandboxFlags sandbox_flags) { | 258 blink::WebSandboxFlags sandbox_flags) { |
| 246 pending_sandbox_flags_ = sandbox_flags; | 259 pending_sandbox_flags_ = sandbox_flags; |
| 247 | 260 |
| 248 // Subframes should always inherit their parent's sandbox flags. | 261 // Subframes should always inherit their parent's sandbox flags. |
| 249 if (parent()) | 262 if (parent()) |
| 250 pending_sandbox_flags_ |= parent()->effective_sandbox_flags(); | 263 pending_sandbox_flags_ |= parent()->effective_sandbox_flags(); |
| 251 } | 264 } |
| 252 | 265 |
| 253 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { | 266 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 481 |
| 469 void FrameTreeNode::TraceSnapshot() const { | 482 void FrameTreeNode::TraceSnapshot() const { |
| 470 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( | 483 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( |
| 471 "navigation", "FrameTreeNode", | 484 "navigation", "FrameTreeNode", |
| 472 TRACE_ID_WITH_SCOPE("FrameTreeNode", frame_tree_node_id_), | 485 TRACE_ID_WITH_SCOPE("FrameTreeNode", frame_tree_node_id_), |
| 473 scoped_ptr<base::trace_event::ConvertableToTraceFormat>( | 486 scoped_ptr<base::trace_event::ConvertableToTraceFormat>( |
| 474 new TracedFrameTreeNode(*this))); | 487 new TracedFrameTreeNode(*this))); |
| 475 } | 488 } |
| 476 | 489 |
| 477 } // namespace content | 490 } // namespace content |
| OLD | NEW |