OLD | NEW |
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 render_view->webview()->setMainFrame(web_frame); | 93 render_view->webview()->setMainFrame(web_frame); |
94 render_widget = render_view; | 94 render_widget = render_view; |
95 } else { | 95 } else { |
96 // Create a frame under an existing parent. The parent is always expected | 96 // Create a frame under an existing parent. The parent is always expected |
97 // to be a RenderFrameProxy, because navigations initiated by local frames | 97 // to be a RenderFrameProxy, because navigations initiated by local frames |
98 // should not wind up here. | 98 // should not wind up here. |
99 | 99 |
100 web_frame = parent->web_frame()->createRemoteChild( | 100 web_frame = parent->web_frame()->createRemoteChild( |
101 replicated_state.scope, | 101 replicated_state.scope, |
102 blink::WebString::fromUTF8(replicated_state.name), | 102 blink::WebString::fromUTF8(replicated_state.name), |
| 103 blink::WebString::fromUTF8(replicated_state.unique_name), |
103 replicated_state.sandbox_flags, proxy.get()); | 104 replicated_state.sandbox_flags, proxy.get()); |
104 render_view = parent->render_view(); | 105 render_view = parent->render_view(); |
105 render_widget = parent->render_widget(); | 106 render_widget = parent->render_widget(); |
106 } | 107 } |
107 | 108 |
108 blink::WebFrame* opener = | 109 blink::WebFrame* opener = |
109 RenderFrameImpl::ResolveOpener(opener_routing_id, nullptr); | 110 RenderFrameImpl::ResolveOpener(opener_routing_id, nullptr); |
110 web_frame->setOpener(opener); | 111 web_frame->setOpener(opener); |
111 | 112 |
112 proxy->Init(web_frame, render_view, render_widget); | 113 proxy->Init(web_frame, render_view, render_widget); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 209 |
209 void RenderFrameProxy::DidCommitCompositorFrame() { | 210 void RenderFrameProxy::DidCommitCompositorFrame() { |
210 if (compositing_helper_.get()) | 211 if (compositing_helper_.get()) |
211 compositing_helper_->DidCommitCompositorFrame(); | 212 compositing_helper_->DidCommitCompositorFrame(); |
212 } | 213 } |
213 | 214 |
214 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { | 215 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { |
215 DCHECK(web_frame_); | 216 DCHECK(web_frame_); |
216 web_frame_->setReplicatedOrigin(state.origin); | 217 web_frame_->setReplicatedOrigin(state.origin); |
217 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); | 218 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); |
218 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); | 219 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name), |
| 220 blink::WebString::fromUTF8(state.unique_name)); |
219 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( | 221 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
220 state.should_enforce_strict_mixed_content_checking); | 222 state.should_enforce_strict_mixed_content_checking); |
221 } | 223 } |
222 | 224 |
223 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags | 225 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags |
224 // that were set by its parent in another process. | 226 // that were set by its parent in another process. |
225 // | 227 // |
226 // Normally, when a frame's sandbox attribute is changed dynamically, the | 228 // Normally, when a frame's sandbox attribute is changed dynamically, the |
227 // frame's FrameOwner is updated with the new sandbox flags right away, while | 229 // frame's FrameOwner is updated with the new sandbox flags right away, while |
228 // the frame's SecurityContext is updated when the frame is navigated and the | 230 // the frame's SecurityContext is updated when the frame is navigated and the |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 if (IsMainFrameDetachedFromTree()) | 358 if (IsMainFrameDetachedFromTree()) |
357 return; | 359 return; |
358 | 360 |
359 web_frame_->didStopLoading(); | 361 web_frame_->didStopLoading(); |
360 } | 362 } |
361 | 363 |
362 void RenderFrameProxy::OnDispatchLoad() { | 364 void RenderFrameProxy::OnDispatchLoad() { |
363 web_frame_->DispatchLoadEventForFrameOwner(); | 365 web_frame_->DispatchLoadEventForFrameOwner(); |
364 } | 366 } |
365 | 367 |
366 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { | 368 void RenderFrameProxy::OnDidUpdateName(const std::string& name, |
367 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); | 369 const std::string& unique_name) { |
| 370 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name), |
| 371 blink::WebString::fromUTF8(unique_name)); |
368 } | 372 } |
369 | 373 |
370 void RenderFrameProxy::OnEnforceStrictMixedContentChecking( | 374 void RenderFrameProxy::OnEnforceStrictMixedContentChecking( |
371 bool should_enforce) { | 375 bool should_enforce) { |
372 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( | 376 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
373 should_enforce); | 377 should_enforce); |
374 } | 378 } |
375 | 379 |
376 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { | 380 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { |
377 web_frame_->setReplicatedOrigin(origin); | 381 web_frame_->setReplicatedOrigin(origin); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 blink::WebLocalFrame* source) { | 500 blink::WebLocalFrame* source) { |
497 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 501 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
498 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 502 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
499 } | 503 } |
500 | 504 |
501 void RenderFrameProxy::frameFocused() { | 505 void RenderFrameProxy::frameFocused() { |
502 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 506 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
503 } | 507 } |
504 | 508 |
505 } // namespace | 509 } // namespace |
OLD | NEW |