| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } | 222 } |
| 223 | 223 |
| 224 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { | 224 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { |
| 225 DCHECK(web_frame_); | 225 DCHECK(web_frame_); |
| 226 web_frame_->setReplicatedOrigin(state.origin); | 226 web_frame_->setReplicatedOrigin(state.origin); |
| 227 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); | 227 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); |
| 228 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name), | 228 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name), |
| 229 blink::WebString::fromUTF8(state.unique_name)); | 229 blink::WebString::fromUTF8(state.unique_name)); |
| 230 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( | 230 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
| 231 state.should_enforce_strict_mixed_content_checking); | 231 state.should_enforce_strict_mixed_content_checking); |
| 232 web_frame_->setReplicatedPotentiallyTrustworthyUniqueOrigin( |
| 233 state.is_potentially_trustworthy_unique_origin); |
| 232 } | 234 } |
| 233 | 235 |
| 234 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags | 236 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags |
| 235 // that were set by its parent in another process. | 237 // that were set by its parent in another process. |
| 236 // | 238 // |
| 237 // Normally, when a frame's sandbox attribute is changed dynamically, the | 239 // Normally, when a frame's sandbox attribute is changed dynamically, the |
| 238 // frame's FrameOwner is updated with the new sandbox flags right away, while | 240 // frame's FrameOwner is updated with the new sandbox flags right away, while |
| 239 // the frame's SecurityContext is updated when the frame is navigated and the | 241 // the frame's SecurityContext is updated when the frame is navigated and the |
| 240 // new sandbox flags take effect. | 242 // new sandbox flags take effect. |
| 241 // | 243 // |
| (...skipping 25 matching lines...) Expand all Loading... |
| 267 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) | 269 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) |
| 268 IPC_MESSAGE_HANDLER(FrameMsg_SetChildFrameSurface, OnSetChildFrameSurface) | 270 IPC_MESSAGE_HANDLER(FrameMsg_SetChildFrameSurface, OnSetChildFrameSurface) |
| 269 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) | 271 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) |
| 270 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) | 272 IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading) |
| 271 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) | 273 IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading) |
| 272 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 274 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
| 273 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) | 275 IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad) |
| 274 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateName, OnDidUpdateName) | 276 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateName, OnDidUpdateName) |
| 275 IPC_MESSAGE_HANDLER(FrameMsg_EnforceStrictMixedContentChecking, | 277 IPC_MESSAGE_HANDLER(FrameMsg_EnforceStrictMixedContentChecking, |
| 276 OnEnforceStrictMixedContentChecking) | 278 OnEnforceStrictMixedContentChecking) |
| 279 IPC_MESSAGE_HANDLER(FrameMsg_DidSetUniqueOriginPotentiallyTrustworthy, |
| 280 OnDidSetUniqueOriginPotentiallyTrustworthy) |
| 277 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateOrigin, OnDidUpdateOrigin) | 281 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateOrigin, OnDidUpdateOrigin) |
| 278 IPC_MESSAGE_HANDLER(InputMsg_SetFocus, OnSetPageFocus) | 282 IPC_MESSAGE_HANDLER(InputMsg_SetFocus, OnSetPageFocus) |
| 279 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) | 283 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) |
| 280 IPC_MESSAGE_UNHANDLED(handled = false) | 284 IPC_MESSAGE_UNHANDLED(handled = false) |
| 281 IPC_END_MESSAGE_MAP() | 285 IPC_END_MESSAGE_MAP() |
| 282 | 286 |
| 283 // Note: If |handled| is true, |this| may have been deleted. | 287 // Note: If |handled| is true, |this| may have been deleted. |
| 284 return handled; | 288 return handled; |
| 285 } | 289 } |
| 286 | 290 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name), | 363 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name), |
| 360 blink::WebString::fromUTF8(unique_name)); | 364 blink::WebString::fromUTF8(unique_name)); |
| 361 } | 365 } |
| 362 | 366 |
| 363 void RenderFrameProxy::OnEnforceStrictMixedContentChecking( | 367 void RenderFrameProxy::OnEnforceStrictMixedContentChecking( |
| 364 bool should_enforce) { | 368 bool should_enforce) { |
| 365 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( | 369 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
| 366 should_enforce); | 370 should_enforce); |
| 367 } | 371 } |
| 368 | 372 |
| 373 void RenderFrameProxy::OnDidSetUniqueOriginPotentiallyTrustworthy( |
| 374 bool is_unique_origin_potentially_trustworthy) { |
| 375 web_frame_->setReplicatedPotentiallyTrustworthyUniqueOrigin( |
| 376 is_unique_origin_potentially_trustworthy); |
| 377 } |
| 378 |
| 369 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { | 379 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { |
| 370 web_frame_->setReplicatedOrigin(origin); | 380 web_frame_->setReplicatedOrigin(origin); |
| 371 } | 381 } |
| 372 | 382 |
| 373 void RenderFrameProxy::OnSetPageFocus(bool is_focused) { | 383 void RenderFrameProxy::OnSetPageFocus(bool is_focused) { |
| 374 render_view_->SetFocus(is_focused); | 384 render_view_->SetFocus(is_focused); |
| 375 } | 385 } |
| 376 | 386 |
| 377 void RenderFrameProxy::OnSetFocusedFrame() { | 387 void RenderFrameProxy::OnSetFocusedFrame() { |
| 378 // This uses focusDocumentView rather than setFocusedFrame so that blur | 388 // This uses focusDocumentView rather than setFocusedFrame so that blur |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 blink::WebLocalFrame* source) { | 499 blink::WebLocalFrame* source) { |
| 490 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 500 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
| 491 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 501 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
| 492 } | 502 } |
| 493 | 503 |
| 494 void RenderFrameProxy::frameFocused() { | 504 void RenderFrameProxy::frameFocused() { |
| 495 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 505 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
| 496 } | 506 } |
| 497 | 507 |
| 498 } // namespace | 508 } // namespace |
| OLD | NEW |