| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 void RenderFrameProxy::DidCommitCompositorFrame() { | 167 void RenderFrameProxy::DidCommitCompositorFrame() { |
| 168 if (compositing_helper_.get()) | 168 if (compositing_helper_.get()) |
| 169 compositing_helper_->DidCommitCompositorFrame(); | 169 compositing_helper_->DidCommitCompositorFrame(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { | 172 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { |
| 173 DCHECK(web_frame_); | 173 DCHECK(web_frame_); |
| 174 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( | 174 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( |
| 175 blink::WebString::fromUTF8(state.origin.string()))); | 175 blink::WebString::fromUTF8(state.origin.serialize()))); |
| 176 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); | 176 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); |
| 177 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); | 177 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); |
| 178 } | 178 } |
| 179 | 179 |
| 180 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags | 180 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags |
| 181 // that were set by its parent in another process. | 181 // that were set by its parent in another process. |
| 182 // | 182 // |
| 183 // Normally, when a frame's sandbox attribute is changed dynamically, the | 183 // Normally, when a frame's sandbox attribute is changed dynamically, the |
| 184 // frame's FrameOwner is updated with the new sandbox flags right away, while | 184 // frame's FrameOwner is updated with the new sandbox flags right away, while |
| 185 // the frame's SecurityContext is updated when the frame is navigated and the | 185 // the frame's SecurityContext is updated when the frame is navigated and the |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 void RenderFrameProxy::OnDispatchLoad() { | 299 void RenderFrameProxy::OnDispatchLoad() { |
| 300 web_frame_->DispatchLoadEventForFrameOwner(); | 300 web_frame_->DispatchLoadEventForFrameOwner(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { | 303 void RenderFrameProxy::OnDidUpdateName(const std::string& name) { |
| 304 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); | 304 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { | 307 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { |
| 308 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( | 308 web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString( |
| 309 blink::WebString::fromUTF8(origin.string()))); | 309 blink::WebString::fromUTF8(origin.serialize()))); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void RenderFrameProxy::frameDetached() { | 312 void RenderFrameProxy::frameDetached() { |
| 313 if (web_frame_->parent()) { | 313 if (web_frame_->parent()) { |
| 314 web_frame_->parent()->removeChild(web_frame_); | 314 web_frame_->parent()->removeChild(web_frame_); |
| 315 | 315 |
| 316 // Let the browser process know this subframe is removed, so that it is | 316 // Let the browser process know this subframe is removed, so that it is |
| 317 // destroyed in its current process. | 317 // destroyed in its current process. |
| 318 Send(new FrameHostMsg_Detach(routing_id_)); | 318 Send(new FrameHostMsg_Detach(routing_id_)); |
| 319 } | 319 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 blink::WebUserGestureIndicator::isProcessingUserGesture(); | 384 blink::WebUserGestureIndicator::isProcessingUserGesture(); |
| 385 blink::WebUserGestureIndicator::consumeUserGesture(); | 385 blink::WebUserGestureIndicator::consumeUserGesture(); |
| 386 Send(new FrameHostMsg_OpenURL(routing_id_, params)); | 386 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
| 387 } | 387 } |
| 388 | 388 |
| 389 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { | 389 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { |
| 390 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); | 390 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); |
| 391 } | 391 } |
| 392 | 392 |
| 393 } // namespace | 393 } // namespace |
| OLD | NEW |