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

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

Issue 1635873003: Replicating WebFrame::uniqueName across renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3
Patch Set: Rebasing... Created 4 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/macros.h" 10 #include "base/macros.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 FrameTreeNode::FrameTreeNode( 72 FrameTreeNode::FrameTreeNode(
73 FrameTree* frame_tree, 73 FrameTree* frame_tree,
74 Navigator* navigator, 74 Navigator* navigator,
75 RenderFrameHostDelegate* render_frame_delegate, 75 RenderFrameHostDelegate* render_frame_delegate,
76 RenderViewHostDelegate* render_view_delegate, 76 RenderViewHostDelegate* render_view_delegate,
77 RenderWidgetHostDelegate* render_widget_delegate, 77 RenderWidgetHostDelegate* render_widget_delegate,
78 RenderFrameHostManager::Delegate* manager_delegate, 78 RenderFrameHostManager::Delegate* manager_delegate,
79 blink::WebTreeScopeType scope, 79 blink::WebTreeScopeType scope,
80 const std::string& name, 80 const std::string& name,
81 const std::string& unique_name,
81 const blink::WebFrameOwnerProperties& frame_owner_properties) 82 const blink::WebFrameOwnerProperties& frame_owner_properties)
82 : frame_tree_(frame_tree), 83 : frame_tree_(frame_tree),
83 navigator_(navigator), 84 navigator_(navigator),
84 render_manager_(this, 85 render_manager_(this,
85 render_frame_delegate, 86 render_frame_delegate,
86 render_view_delegate, 87 render_view_delegate,
87 render_widget_delegate, 88 render_widget_delegate,
88 manager_delegate), 89 manager_delegate),
89 frame_tree_node_id_(next_frame_tree_node_id_++), 90 frame_tree_node_id_(next_frame_tree_node_id_++),
90 parent_(NULL), 91 parent_(NULL),
91 opener_(nullptr), 92 opener_(nullptr),
92 opener_observer_(nullptr), 93 opener_observer_(nullptr),
93 has_committed_real_load_(false), 94 has_committed_real_load_(false),
94 replication_state_( 95 replication_state_(
95 scope, 96 scope,
96 name, 97 name,
98 unique_name,
97 blink::WebSandboxFlags::None, 99 blink::WebSandboxFlags::None,
98 false /* should enforce strict mixed content checking */), 100 false /* should enforce strict mixed content checking */),
99 pending_sandbox_flags_(blink::WebSandboxFlags::None), 101 pending_sandbox_flags_(blink::WebSandboxFlags::None),
100 frame_owner_properties_(frame_owner_properties), 102 frame_owner_properties_(frame_owner_properties),
101 loading_progress_(kLoadingProgressNotStarted) { 103 loading_progress_(kLoadingProgressNotStarted) {
102 std::pair<FrameTreeNodeIdMap::iterator, bool> result = 104 std::pair<FrameTreeNodeIdMap::iterator, bool> result =
103 g_frame_tree_node_id_map.Get().insert( 105 g_frame_tree_node_id_map.Get().insert(
104 std::make_pair(frame_tree_node_id_, this)); 106 std::make_pair(frame_tree_node_id_, this));
105 CHECK(result.second); 107 CHECK(result.second);
106 } 108 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 has_committed_real_load_ = true; 198 has_committed_real_load_ = true;
197 current_url_ = url; 199 current_url_ = url;
198 } 200 }
199 201
200 void FrameTreeNode::SetCurrentOrigin(const url::Origin& origin) { 202 void FrameTreeNode::SetCurrentOrigin(const url::Origin& origin) {
201 if (!origin.IsSameOriginWith(replication_state_.origin)) 203 if (!origin.IsSameOriginWith(replication_state_.origin))
202 render_manager_.OnDidUpdateOrigin(origin); 204 render_manager_.OnDidUpdateOrigin(origin);
203 replication_state_.origin = origin; 205 replication_state_.origin = origin;
204 } 206 }
205 207
206 void FrameTreeNode::SetFrameName(const std::string& name) { 208 void FrameTreeNode::SetFrameName(const std::string& name,
209 const std::string& unique_name) {
207 if (name != replication_state_.name) 210 if (name != replication_state_.name)
208 render_manager_.OnDidUpdateName(name); 211 render_manager_.OnDidUpdateName(name);
Charlie Reis 2016/01/27 23:48:49 Don't we need to broadcast the new unique_name to
Łukasz Anforowicz 2016/01/28 01:21:19 Ooops. Good catch - I looked at RenderFrameHostIm
209 replication_state_.name = name; 212 replication_state_.name = name;
213 replication_state_.unique_name = unique_name;
210 } 214 }
211 215
212 void FrameTreeNode::SetEnforceStrictMixedContentChecking(bool should_enforce) { 216 void FrameTreeNode::SetEnforceStrictMixedContentChecking(bool should_enforce) {
213 if (should_enforce == 217 if (should_enforce ==
214 replication_state_.should_enforce_strict_mixed_content_checking) { 218 replication_state_.should_enforce_strict_mixed_content_checking) {
215 return; 219 return;
216 } 220 }
217 render_manager_.OnEnforceStrictMixedContentChecking(should_enforce); 221 render_manager_.OnEnforceStrictMixedContentChecking(should_enforce);
218 replication_state_.should_enforce_strict_mixed_content_checking = 222 replication_state_.should_enforce_strict_mixed_content_checking =
219 should_enforce; 223 should_enforce;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 render_manager_.Stop(); 403 render_manager_.Stop();
400 return true; 404 return true;
401 } 405 }
402 406
403 void FrameTreeNode::DidFocus() { 407 void FrameTreeNode::DidFocus() {
404 last_focus_time_ = base::TimeTicks::Now(); 408 last_focus_time_ = base::TimeTicks::Now();
405 FOR_EACH_OBSERVER(Observer, observers_, OnFrameTreeNodeFocused(this)); 409 FOR_EACH_OBSERVER(Observer, observers_, OnFrameTreeNodeFocused(this));
406 } 410 }
407 411
408 } // namespace content 412 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698