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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Extend tests, fix redirects. Non-PlzNavigate version still broken. Created 3 years, 10 months 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/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 render_frame_delegate, 99 render_frame_delegate,
100 render_widget_delegate, 100 render_widget_delegate,
101 manager_delegate), 101 manager_delegate),
102 frame_tree_node_id_(next_frame_tree_node_id_++), 102 frame_tree_node_id_(next_frame_tree_node_id_++),
103 parent_(parent), 103 parent_(parent),
104 opener_(nullptr), 104 opener_(nullptr),
105 opener_observer_(nullptr), 105 opener_observer_(nullptr),
106 original_opener_(nullptr), 106 original_opener_(nullptr),
107 original_opener_observer_(nullptr), 107 original_opener_observer_(nullptr),
108 has_committed_real_load_(false), 108 has_committed_real_load_(false),
109 is_collapsed_by_client_(false),
109 replication_state_( 110 replication_state_(
110 scope, 111 scope,
111 name, 112 name,
112 unique_name, 113 unique_name,
113 blink::WebSandboxFlags::None, 114 blink::WebSandboxFlags::None,
114 false /* should enforce strict mixed content checking */, 115 false /* should enforce strict mixed content checking */,
115 false /* is a potentially trustworthy unique origin */, 116 false /* is a potentially trustworthy unique origin */,
116 false /* has received a user gesture */), 117 false /* has received a user gesture */),
117 pending_sandbox_flags_(blink::WebSandboxFlags::None), 118 pending_sandbox_flags_(blink::WebSandboxFlags::None),
118 frame_owner_properties_(frame_owner_properties), 119 frame_owner_properties_(frame_owner_properties),
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 replication_state_.has_potentially_trustworthy_unique_origin != 253 replication_state_.has_potentially_trustworthy_unique_origin !=
253 is_potentially_trustworthy_unique_origin) { 254 is_potentially_trustworthy_unique_origin) {
254 render_manager_.OnDidUpdateOrigin(origin, 255 render_manager_.OnDidUpdateOrigin(origin,
255 is_potentially_trustworthy_unique_origin); 256 is_potentially_trustworthy_unique_origin);
256 } 257 }
257 replication_state_.origin = origin; 258 replication_state_.origin = origin;
258 replication_state_.has_potentially_trustworthy_unique_origin = 259 replication_state_.has_potentially_trustworthy_unique_origin =
259 is_potentially_trustworthy_unique_origin; 260 is_potentially_trustworthy_unique_origin;
260 } 261 }
261 262
263 void FrameTreeNode::SetCollapsedByClient(bool collapsed) {
264 DCHECK(!IsMainFrame());
265 if (is_collapsed_by_client_ == collapsed)
266 return;
267
268 is_collapsed_by_client_ = collapsed;
269 render_manager_.OnDidChangeCollapsedByClientState(collapsed);
nasko 2017/03/01 20:08:04 Does the "ByClientState" part of the name add any
engedy 2017/04/10 14:36:41 I wanted to disambiguate between client- and conte
270 }
271
262 void FrameTreeNode::SetFrameName(const std::string& name, 272 void FrameTreeNode::SetFrameName(const std::string& name,
263 const std::string& unique_name) { 273 const std::string& unique_name) {
264 if (name == replication_state_.name) { 274 if (name == replication_state_.name) {
265 // |unique_name| shouldn't change unless |name| changes. 275 // |unique_name| shouldn't change unless |name| changes.
266 DCHECK_EQ(unique_name, replication_state_.unique_name); 276 DCHECK_EQ(unique_name, replication_state_.unique_name);
267 return; 277 return;
268 } 278 }
269 279
270 if (parent()) { 280 if (parent()) {
271 // Non-main frames should have a non-empty unique name. 281 // Non-main frames should have a non-empty unique name.
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } 563 }
554 return parent_->child_at(i + relative_offset); 564 return parent_->child_at(i + relative_offset);
555 } 565 }
556 } 566 }
557 567
558 NOTREACHED() << "FrameTreeNode not found in its parent's children."; 568 NOTREACHED() << "FrameTreeNode not found in its parent's children.";
559 return nullptr; 569 return nullptr;
560 } 570 }
561 571
562 } // namespace content 572 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698