| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 207 } |
| 207 } | 208 } |
| 208 | 209 |
| 209 void RenderFrameProxy::DidCommitCompositorFrame() { | 210 void RenderFrameProxy::DidCommitCompositorFrame() { |
| 210 } | 211 } |
| 211 | 212 |
| 212 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { | 213 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { |
| 213 DCHECK(web_frame_); | 214 DCHECK(web_frame_); |
| 214 web_frame_->setReplicatedOrigin(state.origin); | 215 web_frame_->setReplicatedOrigin(state.origin); |
| 215 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); | 216 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); |
| 216 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); | 217 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name), |
| 218 blink::WebString::fromUTF8(state.unique_name)); |
| 217 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( | 219 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
| 218 state.should_enforce_strict_mixed_content_checking); | 220 state.should_enforce_strict_mixed_content_checking); |
| 219 } | 221 } |
| 220 | 222 |
| 221 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags | 223 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags |
| 222 // that were set by its parent in another process. | 224 // that were set by its parent in another process. |
| 223 // | 225 // |
| 224 // Normally, when a frame's sandbox attribute is changed dynamically, the | 226 // Normally, when a frame's sandbox attribute is changed dynamically, the |
| 225 // frame's FrameOwner is updated with the new sandbox flags right away, while | 227 // frame's FrameOwner is updated with the new sandbox flags right away, while |
| 226 // the frame's SecurityContext is updated when the frame is navigated and the | 228 // 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 Loading... |
| 326 if (IsMainFrameDetachedFromTree()) | 328 if (IsMainFrameDetachedFromTree()) |
| 327 return; | 329 return; |
| 328 | 330 |
| 329 web_frame_->didStopLoading(); | 331 web_frame_->didStopLoading(); |
| 330 } | 332 } |
| 331 | 333 |
| 332 void RenderFrameProxy::OnDispatchLoad() { | 334 void RenderFrameProxy::OnDispatchLoad() { |
| 333 web_frame_->DispatchLoadEventForFrameOwner(); | 335 web_frame_->DispatchLoadEventForFrameOwner(); |
| 334 } | 336 } |
| 335 | 337 |
| 336 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { | 338 void RenderFrameProxy::OnDidUpdateName(const std::string& name, |
| 337 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); | 339 const std::string& unique_name) { |
| 340 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name), |
| 341 blink::WebString::fromUTF8(unique_name)); |
| 338 } | 342 } |
| 339 | 343 |
| 340 void RenderFrameProxy::OnEnforceStrictMixedContentChecking( | 344 void RenderFrameProxy::OnEnforceStrictMixedContentChecking( |
| 341 bool should_enforce) { | 345 bool should_enforce) { |
| 342 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( | 346 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
| 343 should_enforce); | 347 should_enforce); |
| 344 } | 348 } |
| 345 | 349 |
| 346 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { | 350 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { |
| 347 web_frame_->setReplicatedOrigin(origin); | 351 web_frame_->setReplicatedOrigin(origin); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 blink::WebLocalFrame* source) { | 470 blink::WebLocalFrame* source) { |
| 467 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 471 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
| 468 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 472 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
| 469 } | 473 } |
| 470 | 474 |
| 471 void RenderFrameProxy::frameFocused() { | 475 void RenderFrameProxy::frameFocused() { |
| 472 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 476 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
| 473 } | 477 } |
| 474 | 478 |
| 475 } // namespace | 479 } // namespace |
| OLD | NEW |