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

Side by Side Diff: content/renderer/render_frame_proxy.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
« no previous file with comments | « content/renderer/render_frame_proxy.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/renderer/render_frame_proxy.h" 5 #include "content/renderer/render_frame_proxy.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 render_view->webview()->setMainFrame(web_frame); 103 render_view->webview()->setMainFrame(web_frame);
104 render_widget = render_view; 104 render_widget = render_view;
105 } else { 105 } else {
106 // Create a frame under an existing parent. The parent is always expected 106 // Create a frame under an existing parent. The parent is always expected
107 // to be a RenderFrameProxy, because navigations initiated by local frames 107 // to be a RenderFrameProxy, because navigations initiated by local frames
108 // should not wind up here. 108 // should not wind up here.
109 109
110 web_frame = parent->web_frame()->createRemoteChild( 110 web_frame = parent->web_frame()->createRemoteChild(
111 replicated_state.scope, 111 replicated_state.scope,
112 blink::WebString::fromUTF8(replicated_state.name), 112 blink::WebString::fromUTF8(replicated_state.name),
113 blink::WebString::fromUTF8(replicated_state.unique_name),
113 replicated_state.sandbox_flags, proxy.get()); 114 replicated_state.sandbox_flags, proxy.get());
114 render_view = parent->render_view(); 115 render_view = parent->render_view();
115 render_widget = parent->render_widget(); 116 render_widget = parent->render_widget();
116 } 117 }
117 118
118 blink::WebFrame* opener = 119 blink::WebFrame* opener =
119 RenderFrameImpl::ResolveOpener(opener_routing_id, nullptr); 120 RenderFrameImpl::ResolveOpener(opener_routing_id, nullptr);
120 web_frame->setOpener(opener); 121 web_frame->setOpener(opener);
121 122
122 proxy->Init(web_frame, render_view, render_widget); 123 proxy->Init(web_frame, render_view, render_widget);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 217 }
217 } 218 }
218 219
219 void RenderFrameProxy::DidCommitCompositorFrame() { 220 void RenderFrameProxy::DidCommitCompositorFrame() {
220 } 221 }
221 222
222 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { 223 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) {
223 DCHECK(web_frame_); 224 DCHECK(web_frame_);
224 web_frame_->setReplicatedOrigin(state.origin); 225 web_frame_->setReplicatedOrigin(state.origin);
225 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); 226 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags);
226 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); 227 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name),
228 blink::WebString::fromUTF8(state.unique_name));
227 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( 229 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking(
228 state.should_enforce_strict_mixed_content_checking); 230 state.should_enforce_strict_mixed_content_checking);
229 } 231 }
230 232
231 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags 233 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags
232 // that were set by its parent in another process. 234 // that were set by its parent in another process.
233 // 235 //
234 // Normally, when a frame's sandbox attribute is changed dynamically, the 236 // Normally, when a frame's sandbox attribute is changed dynamically, the
235 // frame's FrameOwner is updated with the new sandbox flags right away, while 237 // frame's FrameOwner is updated with the new sandbox flags right away, while
236 // the frame's SecurityContext is updated when the frame is navigated and the 238 // the frame's SecurityContext is updated when the frame is navigated and the
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 if (IsMainFrameDetachedFromTree()) 338 if (IsMainFrameDetachedFromTree())
337 return; 339 return;
338 340
339 web_frame_->didStopLoading(); 341 web_frame_->didStopLoading();
340 } 342 }
341 343
342 void RenderFrameProxy::OnDispatchLoad() { 344 void RenderFrameProxy::OnDispatchLoad() {
343 web_frame_->DispatchLoadEventForFrameOwner(); 345 web_frame_->DispatchLoadEventForFrameOwner();
344 } 346 }
345 347
346 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { 348 void RenderFrameProxy::OnDidUpdateName(const std::string& name,
347 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); 349 const std::string& unique_name) {
350 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name),
351 blink::WebString::fromUTF8(unique_name));
348 } 352 }
349 353
350 void RenderFrameProxy::OnEnforceStrictMixedContentChecking( 354 void RenderFrameProxy::OnEnforceStrictMixedContentChecking(
351 bool should_enforce) { 355 bool should_enforce) {
352 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( 356 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking(
353 should_enforce); 357 should_enforce);
354 } 358 }
355 359
356 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { 360 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) {
357 web_frame_->setReplicatedOrigin(origin); 361 web_frame_->setReplicatedOrigin(origin);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 blink::WebLocalFrame* source) { 480 blink::WebLocalFrame* source) {
477 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); 481 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID();
478 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); 482 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id));
479 } 483 }
480 484
481 void RenderFrameProxy::frameFocused() { 485 void RenderFrameProxy::frameFocused() {
482 Send(new FrameHostMsg_FrameFocused(routing_id_)); 486 Send(new FrameHostMsg_FrameFocused(routing_id_));
483 } 487 }
484 488
485 } // namespace 489 } // namespace
OLDNEW
« no previous file with comments | « content/renderer/render_frame_proxy.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698