| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 FrameTreeNode::FrameTreeNode( | 72 FrameTreeNode::FrameTreeNode( |
| 73 FrameTree* frame_tree, | 73 FrameTree* frame_tree, |
| 74 Navigator* navigator, | 74 Navigator* navigator, |
| 75 RenderFrameHostDelegate* render_frame_delegate, | 75 RenderFrameHostDelegate* render_frame_delegate, |
| 76 RenderViewHostDelegate* render_view_delegate, | 76 RenderViewHostDelegate* render_view_delegate, |
| 77 RenderWidgetHostDelegate* render_widget_delegate, | 77 RenderWidgetHostDelegate* render_widget_delegate, |
| 78 RenderFrameHostManager::Delegate* manager_delegate, | 78 RenderFrameHostManager::Delegate* manager_delegate, |
| 79 blink::WebTreeScopeType scope, | 79 blink::WebTreeScopeType scope, |
| 80 const std::string& name, | 80 const std::string& name, |
| 81 const std::string& unique_name, |
| 81 const blink::WebFrameOwnerProperties& frame_owner_properties) | 82 const blink::WebFrameOwnerProperties& frame_owner_properties) |
| 82 : frame_tree_(frame_tree), | 83 : frame_tree_(frame_tree), |
| 83 navigator_(navigator), | 84 navigator_(navigator), |
| 84 render_manager_(this, | 85 render_manager_(this, |
| 85 render_frame_delegate, | 86 render_frame_delegate, |
| 86 render_view_delegate, | 87 render_view_delegate, |
| 87 render_widget_delegate, | 88 render_widget_delegate, |
| 88 manager_delegate), | 89 manager_delegate), |
| 89 frame_tree_node_id_(next_frame_tree_node_id_++), | 90 frame_tree_node_id_(next_frame_tree_node_id_++), |
| 90 parent_(NULL), | 91 parent_(NULL), |
| 91 opener_(nullptr), | 92 opener_(nullptr), |
| 92 opener_observer_(nullptr), | 93 opener_observer_(nullptr), |
| 93 has_committed_real_load_(false), | 94 has_committed_real_load_(false), |
| 94 replication_state_( | 95 replication_state_( |
| 95 scope, | 96 scope, |
| 96 name, | 97 name, |
| 98 unique_name, |
| 97 blink::WebSandboxFlags::None, | 99 blink::WebSandboxFlags::None, |
| 98 false /* should enforce strict mixed content checking */), | 100 false /* should enforce strict mixed content checking */), |
| 99 pending_sandbox_flags_(blink::WebSandboxFlags::None), | 101 pending_sandbox_flags_(blink::WebSandboxFlags::None), |
| 100 frame_owner_properties_(frame_owner_properties), | 102 frame_owner_properties_(frame_owner_properties), |
| 101 loading_progress_(kLoadingProgressNotStarted) { | 103 loading_progress_(kLoadingProgressNotStarted) { |
| 102 std::pair<FrameTreeNodeIdMap::iterator, bool> result = | 104 std::pair<FrameTreeNodeIdMap::iterator, bool> result = |
| 103 g_frame_tree_node_id_map.Get().insert( | 105 g_frame_tree_node_id_map.Get().insert( |
| 104 std::make_pair(frame_tree_node_id_, this)); | 106 std::make_pair(frame_tree_node_id_, this)); |
| 105 CHECK(result.second); | 107 CHECK(result.second); |
| 106 } | 108 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 has_committed_real_load_ = true; | 198 has_committed_real_load_ = true; |
| 197 current_url_ = url; | 199 current_url_ = url; |
| 198 } | 200 } |
| 199 | 201 |
| 200 void FrameTreeNode::SetCurrentOrigin(const url::Origin& origin) { | 202 void FrameTreeNode::SetCurrentOrigin(const url::Origin& origin) { |
| 201 if (!origin.IsSameOriginWith(replication_state_.origin)) | 203 if (!origin.IsSameOriginWith(replication_state_.origin)) |
| 202 render_manager_.OnDidUpdateOrigin(origin); | 204 render_manager_.OnDidUpdateOrigin(origin); |
| 203 replication_state_.origin = origin; | 205 replication_state_.origin = origin; |
| 204 } | 206 } |
| 205 | 207 |
| 206 void FrameTreeNode::SetFrameName(const std::string& name) { | 208 void FrameTreeNode::SetFrameName(const std::string& name, |
| 207 if (name != replication_state_.name) | 209 const std::string& unique_name) { |
| 208 render_manager_.OnDidUpdateName(name); | 210 if (name == replication_state_.name) { |
| 211 // |unique_name| shouldn't change unless |name| changes. |
| 212 DCHECK_EQ(unique_name, replication_state_.unique_name); |
| 213 return; |
| 214 } |
| 215 render_manager_.OnDidUpdateName(name, unique_name); |
| 209 replication_state_.name = name; | 216 replication_state_.name = name; |
| 217 replication_state_.unique_name = unique_name; |
| 210 } | 218 } |
| 211 | 219 |
| 212 void FrameTreeNode::SetEnforceStrictMixedContentChecking(bool should_enforce) { | 220 void FrameTreeNode::SetEnforceStrictMixedContentChecking(bool should_enforce) { |
| 213 if (should_enforce == | 221 if (should_enforce == |
| 214 replication_state_.should_enforce_strict_mixed_content_checking) { | 222 replication_state_.should_enforce_strict_mixed_content_checking) { |
| 215 return; | 223 return; |
| 216 } | 224 } |
| 217 render_manager_.OnEnforceStrictMixedContentChecking(should_enforce); | 225 render_manager_.OnEnforceStrictMixedContentChecking(should_enforce); |
| 218 replication_state_.should_enforce_strict_mixed_content_checking = | 226 replication_state_.should_enforce_strict_mixed_content_checking = |
| 219 should_enforce; | 227 should_enforce; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 speculative_frame_host->ResetLoadingState(); | 433 speculative_frame_host->ResetLoadingState(); |
| 426 } else { | 434 } else { |
| 427 RenderFrameHostImpl* pending_frame_host = | 435 RenderFrameHostImpl* pending_frame_host = |
| 428 render_manager_.pending_frame_host(); | 436 render_manager_.pending_frame_host(); |
| 429 if (pending_frame_host) | 437 if (pending_frame_host) |
| 430 pending_frame_host->ResetLoadingState(); | 438 pending_frame_host->ResetLoadingState(); |
| 431 } | 439 } |
| 432 } | 440 } |
| 433 | 441 |
| 434 } // namespace content | 442 } // namespace content |
| OLD | NEW |