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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 207 } |
207 } | 208 } |
208 | 209 |
209 void FrameTreeNode::SetCurrentURL(const GURL& url) { | 210 void FrameTreeNode::SetCurrentURL(const GURL& url) { |
210 if (!has_committed_real_load_ && url != GURL(url::kAboutBlankURL)) | 211 if (!has_committed_real_load_ && url != GURL(url::kAboutBlankURL)) |
211 has_committed_real_load_ = true; | 212 has_committed_real_load_ = true; |
212 current_frame_host()->set_last_committed_url(url); | 213 current_frame_host()->set_last_committed_url(url); |
213 TraceSnapshot(); | 214 TraceSnapshot(); |
214 } | 215 } |
215 | 216 |
216 void FrameTreeNode::SetCurrentOrigin(const url::Origin& origin) { | 217 void FrameTreeNode::SetCurrentOrigin( |
217 if (!origin.IsSameOriginWith(replication_state_.origin)) | 218 const url::Origin& origin, |
218 render_manager_.OnDidUpdateOrigin(origin); | 219 bool is_potentially_trustworthy_unique_origin) { |
| 220 if (!origin.IsSameOriginWith(replication_state_.origin) || |
| 221 replication_state_.has_potentially_trustworthy_unique_origin != |
| 222 is_potentially_trustworthy_unique_origin) { |
| 223 render_manager_.OnDidUpdateOrigin(origin, |
| 224 is_potentially_trustworthy_unique_origin); |
| 225 } |
219 replication_state_.origin = origin; | 226 replication_state_.origin = origin; |
| 227 replication_state_.has_potentially_trustworthy_unique_origin = |
| 228 is_potentially_trustworthy_unique_origin; |
220 } | 229 } |
221 | 230 |
222 void FrameTreeNode::SetFrameName(const std::string& name, | 231 void FrameTreeNode::SetFrameName(const std::string& name, |
223 const std::string& unique_name) { | 232 const std::string& unique_name) { |
224 if (name == replication_state_.name) { | 233 if (name == replication_state_.name) { |
225 // |unique_name| shouldn't change unless |name| changes. | 234 // |unique_name| shouldn't change unless |name| changes. |
226 DCHECK_EQ(unique_name, replication_state_.unique_name); | 235 DCHECK_EQ(unique_name, replication_state_.unique_name); |
227 return; | 236 return; |
228 } | 237 } |
229 render_manager_.OnDidUpdateName(name, unique_name); | 238 render_manager_.OnDidUpdateName(name, unique_name); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 477 |
469 void FrameTreeNode::TraceSnapshot() const { | 478 void FrameTreeNode::TraceSnapshot() const { |
470 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( | 479 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( |
471 "navigation", "FrameTreeNode", | 480 "navigation", "FrameTreeNode", |
472 TRACE_ID_WITH_SCOPE("FrameTreeNode", frame_tree_node_id_), | 481 TRACE_ID_WITH_SCOPE("FrameTreeNode", frame_tree_node_id_), |
473 scoped_ptr<base::trace_event::ConvertableToTraceFormat>( | 482 scoped_ptr<base::trace_event::ConvertableToTraceFormat>( |
474 new TracedFrameTreeNode(*this))); | 483 new TracedFrameTreeNode(*this))); |
475 } | 484 } |
476 | 485 |
477 } // namespace content | 486 } // namespace content |
OLD | NEW |