| 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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "content/child/webmessageportchannel_impl.h" | 10 #include "content/child/webmessageportchannel_impl.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 void RenderFrameProxy::DidCommitCompositorFrame() { | 160 void RenderFrameProxy::DidCommitCompositorFrame() { |
| 161 if (compositing_helper_.get()) | 161 if (compositing_helper_.get()) |
| 162 compositing_helper_->DidCommitCompositorFrame(); | 162 compositing_helper_->DidCommitCompositorFrame(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { | 165 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { |
| 166 DCHECK(web_frame_); | 166 DCHECK(web_frame_); |
| 167 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( | 167 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( |
| 168 blink::WebString::fromUTF8(state.origin.string()))); | 168 blink::WebString::fromUTF8(state.origin.serialize()))); |
| 169 web_frame_->setReplicatedSandboxFlags( | 169 web_frame_->setReplicatedSandboxFlags( |
| 170 RenderFrameImpl::ContentToWebSandboxFlags(state.sandbox_flags)); | 170 RenderFrameImpl::ContentToWebSandboxFlags(state.sandbox_flags)); |
| 171 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); | 171 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); |
| 172 } | 172 } |
| 173 | 173 |
| 174 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags | 174 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags |
| 175 // that were set by its parent in another process. | 175 // that were set by its parent in another process. |
| 176 // | 176 // |
| 177 // Normally, when a frame's sandbox attribute is changed dynamically, the | 177 // Normally, when a frame's sandbox attribute is changed dynamically, the |
| 178 // frame's FrameOwner is updated with the new sandbox flags right away, while | 178 // frame's FrameOwner is updated with the new sandbox flags right away, while |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 void RenderFrameProxy::OnDispatchLoad() { | 295 void RenderFrameProxy::OnDispatchLoad() { |
| 296 web_frame_->DispatchLoadEventForFrameOwner(); | 296 web_frame_->DispatchLoadEventForFrameOwner(); |
| 297 } | 297 } |
| 298 | 298 |
| 299 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { | 299 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { |
| 300 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); | 300 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { | 303 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { |
| 304 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( | 304 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( |
| 305 blink::WebString::fromUTF8(origin.string()))); | 305 blink::WebString::fromUTF8(origin.serialize()))); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void RenderFrameProxy::frameDetached() { | 308 void RenderFrameProxy::frameDetached() { |
| 309 if (web_frame_->parent()) { | 309 if (web_frame_->parent()) { |
| 310 web_frame_->parent()->removeChild(web_frame_); | 310 web_frame_->parent()->removeChild(web_frame_); |
| 311 | 311 |
| 312 // Let the browser process know this subframe is removed, so that it is | 312 // Let the browser process know this subframe is removed, so that it is |
| 313 // destroyed in its current process. | 313 // destroyed in its current process. |
| 314 Send(new FrameHostMsg_Detach(routing_id_)); | 314 Send(new FrameHostMsg_Detach(routing_id_)); |
| 315 } | 315 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 blink::WebUserGestureIndicator::isProcessingUserGesture(); | 380 blink::WebUserGestureIndicator::isProcessingUserGesture(); |
| 381 blink::WebUserGestureIndicator::consumeUserGesture(); | 381 blink::WebUserGestureIndicator::consumeUserGesture(); |
| 382 Send(new FrameHostMsg_OpenURL(routing_id_, params)); | 382 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
| 383 } | 383 } |
| 384 | 384 |
| 385 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { | 385 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { |
| 386 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); | 386 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace | 389 } // namespace |
| OLD | NEW |