| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 void RenderFrameProxy::DidCommitCompositorFrame() { | 175 void RenderFrameProxy::DidCommitCompositorFrame() { |
| 176 if (compositing_helper_.get()) | 176 if (compositing_helper_.get()) |
| 177 compositing_helper_->DidCommitCompositorFrame(); | 177 compositing_helper_->DidCommitCompositorFrame(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { | 180 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { |
| 181 DCHECK(web_frame_); | 181 DCHECK(web_frame_); |
| 182 web_frame_->setReplicatedOrigin(state.origin); | 182 web_frame_->setReplicatedOrigin(state.origin); |
| 183 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); | 183 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); |
| 184 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); | 184 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); |
| 185 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
| 186 state.should_enforce_strict_mixed_content_checking); |
| 185 } | 187 } |
| 186 | 188 |
| 187 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags | 189 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags |
| 188 // that were set by its parent in another process. | 190 // that were set by its parent in another process. |
| 189 // | 191 // |
| 190 // Normally, when a frame's sandbox attribute is changed dynamically, the | 192 // Normally, when a frame's sandbox attribute is changed dynamically, the |
| 191 // frame's FrameOwner is updated with the new sandbox flags right away, while | 193 // frame's FrameOwner is updated with the new sandbox flags right away, while |
| 192 // the frame's SecurityContext is updated when the frame is navigated and the | 194 // the frame's SecurityContext is updated when the frame is navigated and the |
| 193 // new sandbox flags take effect. | 195 // new sandbox flags take effect. |
| 194 // | 196 // |
| (...skipping 17 matching lines...) Expand all Loading... |
| 212 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) | 214 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) |
| 213 IPC_MESSAGE_HANDLER_GENERIC(FrameMsg_CompositorFrameSwapped, | 215 IPC_MESSAGE_HANDLER_GENERIC(FrameMsg_CompositorFrameSwapped, |
| 214 OnCompositorFrameSwapped(msg)) | 216 OnCompositorFrameSwapped(msg)) |
| 215 IPC_MESSAGE_HANDLER(FrameMsg_SetChildFrameSurface, OnSetChildFrameSurface) | 217 IPC_MESSAGE_HANDLER(FrameMsg_SetChildFrameSurface, OnSetChildFrameSurface) |
| 216 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) | 218 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) |
| 217 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) | 219 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) |
| 218 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) | 220 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) |
| 219 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 221 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
| 220 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) | 222 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) |
| 221 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateName, OnDidUpdateName) | 223 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateName, OnDidUpdateName) |
| 224 IPC_MESSAGE_HANDLER( |
| 225 FrameMsg_DidUpdateShouldEnforceStrictMixedContentChecking, |
| 226 OnDidUpdateShouldEnforceStrictMixedContentChecking) |
| 222 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateOrigin, OnDidUpdateOrigin) | 227 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateOrigin, OnDidUpdateOrigin) |
| 223 IPC_MESSAGE_HANDLER(InputMsg_SetFocus, OnSetPageFocus) | 228 IPC_MESSAGE_HANDLER(InputMsg_SetFocus, OnSetPageFocus) |
| 224 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) | 229 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) |
| 225 IPC_MESSAGE_UNHANDLED(handled = false) | 230 IPC_MESSAGE_UNHANDLED(handled = false) |
| 226 IPC_END_MESSAGE_MAP() | 231 IPC_END_MESSAGE_MAP() |
| 227 | 232 |
| 228 // Note: If |handled| is true, |this| may have been deleted. | 233 // Note: If |handled| is true, |this| may have been deleted. |
| 229 return handled; | 234 return handled; |
| 230 } | 235 } |
| 231 | 236 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 328 } |
| 324 | 329 |
| 325 void RenderFrameProxy::OnDispatchLoad() { | 330 void RenderFrameProxy::OnDispatchLoad() { |
| 326 web_frame_->DispatchLoadEventForFrameOwner(); | 331 web_frame_->DispatchLoadEventForFrameOwner(); |
| 327 } | 332 } |
| 328 | 333 |
| 329 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { | 334 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { |
| 330 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); | 335 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); |
| 331 } | 336 } |
| 332 | 337 |
| 338 void RenderFrameProxy::OnDidUpdateShouldEnforceStrictMixedContentChecking( |
| 339 bool should_enforce) { |
| 340 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
| 341 should_enforce); |
| 342 } |
| 343 |
| 333 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { | 344 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { |
| 334 web_frame_->setReplicatedOrigin(origin); | 345 web_frame_->setReplicatedOrigin(origin); |
| 335 } | 346 } |
| 336 | 347 |
| 337 void RenderFrameProxy::OnSetPageFocus(bool is_focused) { | 348 void RenderFrameProxy::OnSetPageFocus(bool is_focused) { |
| 338 render_view_->SetFocus(is_focused); | 349 render_view_->SetFocus(is_focused); |
| 339 } | 350 } |
| 340 | 351 |
| 341 void RenderFrameProxy::OnSetFocusedFrame() { | 352 void RenderFrameProxy::OnSetFocusedFrame() { |
| 342 // This uses focusDocumentView rather than setFocusedFrame so that blur | 353 // This uses focusDocumentView rather than setFocusedFrame so that blur |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 Send(new FrameHostMsg_DidChangeOpener(routing_id_, opener_routing_id)); | 455 Send(new FrameHostMsg_DidChangeOpener(routing_id_, opener_routing_id)); |
| 445 } | 456 } |
| 446 | 457 |
| 447 void RenderFrameProxy::advanceFocus(blink::WebFocusType type, | 458 void RenderFrameProxy::advanceFocus(blink::WebFocusType type, |
| 448 blink::WebLocalFrame* source) { | 459 blink::WebLocalFrame* source) { |
| 449 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 460 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
| 450 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 461 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
| 451 } | 462 } |
| 452 | 463 |
| 453 } // namespace | 464 } // namespace |
| OLD | NEW |