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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 // |unique_name| shouldn't change unless |name| changes. | 238 // |unique_name| shouldn't change unless |name| changes. |
| 239 DCHECK_EQ(unique_name, replication_state_.unique_name); | 239 DCHECK_EQ(unique_name, replication_state_.unique_name); |
| 240 return; | 240 return; |
| 241 } | 241 } |
| 242 RecordUniqueNameLength(unique_name.size()); | 242 RecordUniqueNameLength(unique_name.size()); |
| 243 render_manager_.OnDidUpdateName(name, unique_name); | 243 render_manager_.OnDidUpdateName(name, unique_name); |
| 244 replication_state_.name = name; | 244 replication_state_.name = name; |
| 245 replication_state_.unique_name = unique_name; | 245 replication_state_.unique_name = unique_name; |
| 246 } | 246 } |
| 247 | 247 |
| 248 void FrameTreeNode::AddContentSecurityPolicy( | |
| 249 const ContentSecurityPolicyHeader& header) { | |
| 250 // Deduplicate the headers (Blink can send a notification about the same | |
| 251 // header multiple times, as ContentSecurityPolicy object is copied around). | |
|
Łukasz Anforowicz
2016/05/13 23:31:44
I tried to look into why Blink processes the same
alexmos
2016/05/16 16:17:03
Seems like at least two of the copies are plausibl
Łukasz Anforowicz
2016/05/16 19:44:45
Thanks for the suggestion - it worked out really w
alexmos
2016/05/16 22:31:55
Thanks -- yes, sending them right after dispatchin
| |
| 252 for (const auto& other : replication_state_.accumulated_csp_headers) { | |
| 253 if (header.header_value == other.header_value && | |
| 254 header.source == other.source && header.type == other.type) | |
| 255 return; | |
| 256 } | |
| 257 | |
| 258 // Append the newly discovered CSP header and notify render frame proxies. | |
| 259 replication_state_.accumulated_csp_headers.push_back(header); | |
| 260 render_manager_.OnDidAddContentSecurityPolicy(header); | |
| 261 } | |
| 262 | |
| 263 void FrameTreeNode::ResetContentSecurityPolicy() { | |
| 264 replication_state_.accumulated_csp_headers.clear(); | |
| 265 render_manager_.OnDidResetContentSecurityPolicy(); | |
| 266 } | |
| 267 | |
| 248 void FrameTreeNode::SetEnforceStrictMixedContentChecking(bool should_enforce) { | 268 void FrameTreeNode::SetEnforceStrictMixedContentChecking(bool should_enforce) { |
| 249 if (should_enforce == | 269 if (should_enforce == |
| 250 replication_state_.should_enforce_strict_mixed_content_checking) { | 270 replication_state_.should_enforce_strict_mixed_content_checking) { |
| 251 return; | 271 return; |
| 252 } | 272 } |
| 253 render_manager_.OnEnforceStrictMixedContentChecking(should_enforce); | 273 render_manager_.OnEnforceStrictMixedContentChecking(should_enforce); |
| 254 replication_state_.should_enforce_strict_mixed_content_checking = | 274 replication_state_.should_enforce_strict_mixed_content_checking = |
| 255 should_enforce; | 275 should_enforce; |
| 256 } | 276 } |
| 257 | 277 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 488 void FrameTreeNode::TraceSnapshot() const { | 508 void FrameTreeNode::TraceSnapshot() const { |
| 489 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 509 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 490 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( | 510 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( |
| 491 "navigation", "FrameTreeNode", | 511 "navigation", "FrameTreeNode", |
| 492 TRACE_ID_WITH_SCOPE("FrameTreeNode", frame_tree_node_id_), | 512 TRACE_ID_WITH_SCOPE("FrameTreeNode", frame_tree_node_id_), |
| 493 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>( | 513 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>( |
| 494 new TracedFrameTreeNode(*this))); | 514 new TracedFrameTreeNode(*this))); |
| 495 } | 515 } |
| 496 | 516 |
| 497 } // namespace content | 517 } // namespace content |
| OLD | NEW |