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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Moar tests. Created 3 years, 11 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/macros.h" 10 #include "base/macros.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 navigator_(navigator), 89 navigator_(navigator),
90 render_manager_(this, 90 render_manager_(this,
91 render_frame_delegate, 91 render_frame_delegate,
92 render_widget_delegate, 92 render_widget_delegate,
93 manager_delegate), 93 manager_delegate),
94 frame_tree_node_id_(next_frame_tree_node_id_++), 94 frame_tree_node_id_(next_frame_tree_node_id_++),
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 is_frame_owner_collapsed_(false),
99 replication_state_( 100 replication_state_(
100 scope, 101 scope,
101 name, 102 name,
102 unique_name, 103 unique_name,
103 blink::WebSandboxFlags::None, 104 blink::WebSandboxFlags::None,
104 false /* should enforce strict mixed content checking */, 105 false /* should enforce strict mixed content checking */,
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),
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 replication_state_.has_potentially_trustworthy_unique_origin != 227 replication_state_.has_potentially_trustworthy_unique_origin !=
227 is_potentially_trustworthy_unique_origin) { 228 is_potentially_trustworthy_unique_origin) {
228 render_manager_.OnDidUpdateOrigin(origin, 229 render_manager_.OnDidUpdateOrigin(origin,
229 is_potentially_trustworthy_unique_origin); 230 is_potentially_trustworthy_unique_origin);
230 } 231 }
231 replication_state_.origin = origin; 232 replication_state_.origin = origin;
232 replication_state_.has_potentially_trustworthy_unique_origin = 233 replication_state_.has_potentially_trustworthy_unique_origin =
233 is_potentially_trustworthy_unique_origin; 234 is_potentially_trustworthy_unique_origin;
234 } 235 }
235 236
237 void FrameTreeNode::SetFrameOwnerCollapsedState(bool collapsed) {
238 DCHECK(!IsMainFrame());
239 if (is_frame_owner_collapsed_ == collapsed)
240 return;
241
242 is_frame_owner_collapsed_ = collapsed;
243 render_manager_.OnDidUpdateFrameOwnerCollapsedState(collapsed);
244 }
245
236 void FrameTreeNode::SetFrameName(const std::string& name, 246 void FrameTreeNode::SetFrameName(const std::string& name,
237 const std::string& unique_name) { 247 const std::string& unique_name) {
238 if (name == replication_state_.name) { 248 if (name == replication_state_.name) {
239 // |unique_name| shouldn't change unless |name| changes. 249 // |unique_name| shouldn't change unless |name| changes.
240 DCHECK_EQ(unique_name, replication_state_.unique_name); 250 DCHECK_EQ(unique_name, replication_state_.unique_name);
241 return; 251 return;
242 } 252 }
243 253
244 if (parent()) { 254 if (parent()) {
245 // Non-main frames should have a non-empty unique name. 255 // Non-main frames should have a non-empty unique name.
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 531 }
522 return parent_->child_at(i + relative_offset); 532 return parent_->child_at(i + relative_offset);
523 } 533 }
524 } 534 }
525 535
526 NOTREACHED() << "FrameTreeNode not found in its parent's children."; 536 NOTREACHED() << "FrameTreeNode not found in its parent's children.";
527 return nullptr; 537 return nullptr;
528 } 538 }
529 539
530 } // namespace content 540 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698