Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: content/browser/frame_host/frame_tree_node.cc

Issue 2557063002: Upgrade Insecure Requests: bugfixes, tests, and support for OOPIF.
Patch Set: Addressed comments (@nasko #2). Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 parent_(parent), 95 parent_(parent),
96 opener_(nullptr), 96 opener_(nullptr),
97 opener_observer_(nullptr), 97 opener_observer_(nullptr),
98 has_committed_real_load_(false), 98 has_committed_real_load_(false),
99 replication_state_( 99 replication_state_(
100 scope, 100 scope,
101 name, 101 name,
102 unique_name, 102 unique_name,
103 blink::WebSandboxFlags::None, 103 blink::WebSandboxFlags::None,
104 false /* should enforce strict mixed content checking */, 104 false /* should enforce strict mixed content checking */,
105 std::vector<uint32_t>() /* insecure urls to upgrade */,
105 false /* is a potentially trustworthy unique origin */), 106 false /* is a potentially trustworthy unique origin */),
106 pending_sandbox_flags_(blink::WebSandboxFlags::None), 107 pending_sandbox_flags_(blink::WebSandboxFlags::None),
107 frame_owner_properties_(frame_owner_properties), 108 frame_owner_properties_(frame_owner_properties),
108 loading_progress_(kLoadingProgressNotStarted), 109 loading_progress_(kLoadingProgressNotStarted),
109 blame_context_(frame_tree_node_id_, parent) { 110 blame_context_(frame_tree_node_id_, parent) {
110 std::pair<FrameTreeNodeIdMap::iterator, bool> result = 111 std::pair<FrameTreeNodeIdMap::iterator, bool> result =
111 g_frame_tree_node_id_map.Get().insert( 112 g_frame_tree_node_id_map.Get().insert(
112 std::make_pair(frame_tree_node_id_, this)); 113 std::make_pair(frame_tree_node_id_, this));
113 CHECK(result.second); 114 CHECK(result.second);
114 115
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 277 }
277 278
278 void FrameTreeNode::SetInsecureRequestPolicy( 279 void FrameTreeNode::SetInsecureRequestPolicy(
279 blink::WebInsecureRequestPolicy policy) { 280 blink::WebInsecureRequestPolicy policy) {
280 if (policy == replication_state_.insecure_request_policy) 281 if (policy == replication_state_.insecure_request_policy)
281 return; 282 return;
282 render_manager_.OnEnforceInsecureRequestPolicy(policy); 283 render_manager_.OnEnforceInsecureRequestPolicy(policy);
283 replication_state_.insecure_request_policy = policy; 284 replication_state_.insecure_request_policy = policy;
284 } 285 }
285 286
287 void FrameTreeNode::SetInsecureNavigationsSet(
288 const std::vector<uint32_t>& insecure_navigations_set) {
289 DCHECK(std::is_sorted(insecure_navigations_set.begin(),
290 insecure_navigations_set.end()));
291 if (insecure_navigations_set == replication_state_.insecure_navigations_set)
292 return;
293 render_manager_.OnEnforceInsecureNavigationsSet(insecure_navigations_set);
294 replication_state_.insecure_navigations_set = insecure_navigations_set;
295 }
296
286 void FrameTreeNode::SetPendingSandboxFlags( 297 void FrameTreeNode::SetPendingSandboxFlags(
287 blink::WebSandboxFlags sandbox_flags) { 298 blink::WebSandboxFlags sandbox_flags) {
288 pending_sandbox_flags_ = sandbox_flags; 299 pending_sandbox_flags_ = sandbox_flags;
289 300
290 // Subframes should always inherit their parent's sandbox flags. 301 // Subframes should always inherit their parent's sandbox flags.
291 if (parent()) 302 if (parent())
292 pending_sandbox_flags_ |= parent()->effective_sandbox_flags(); 303 pending_sandbox_flags_ |= parent()->effective_sandbox_flags();
293 } 304 }
294 305
295 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { 306 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const {
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 532 }
522 return parent_->child_at(i + relative_offset); 533 return parent_->child_at(i + relative_offset);
523 } 534 }
524 } 535 }
525 536
526 NOTREACHED() << "FrameTreeNode not found in its parent's children."; 537 NOTREACHED() << "FrameTreeNode not found in its parent's children.";
527 return nullptr; 538 return nullptr;
528 } 539 }
529 540
530 } // namespace content 541 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698