| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 if (compositing_helper_.get()) | 189 if (compositing_helper_.get()) |
| 190 compositing_helper_->ChildFrameGone(); | 190 compositing_helper_->ChildFrameGone(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void RenderFrameProxy::OnCompositorFrameSwapped(const IPC::Message& message) { | 193 void RenderFrameProxy::OnCompositorFrameSwapped(const IPC::Message& message) { |
| 194 FrameMsg_CompositorFrameSwapped::Param param; | 194 FrameMsg_CompositorFrameSwapped::Param param; |
| 195 if (!FrameMsg_CompositorFrameSwapped::Read(&message, ¶m)) | 195 if (!FrameMsg_CompositorFrameSwapped::Read(&message, ¶m)) |
| 196 return; | 196 return; |
| 197 | 197 |
| 198 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 198 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
| 199 param.a.frame.AssignTo(frame.get()); | 199 get<0>(param).frame.AssignTo(frame.get()); |
| 200 | 200 |
| 201 if (!compositing_helper_.get()) { | 201 if (!compositing_helper_.get()) { |
| 202 compositing_helper_ = | 202 compositing_helper_ = |
| 203 ChildFrameCompositingHelper::CreateForRenderFrameProxy(this); | 203 ChildFrameCompositingHelper::CreateForRenderFrameProxy(this); |
| 204 compositing_helper_->EnableCompositing(true); | 204 compositing_helper_->EnableCompositing(true); |
| 205 } | 205 } |
| 206 compositing_helper_->OnCompositorFrameSwapped(frame.Pass(), | 206 compositing_helper_->OnCompositorFrameSwapped( |
| 207 param.a.producing_route_id, | 207 frame.Pass(), |
| 208 param.a.output_surface_id, | 208 get<0>(param).producing_route_id, |
| 209 param.a.producing_host_id, | 209 get<0>(param).output_surface_id, |
| 210 param.a.shared_memory_handle); | 210 get<0>(param).producing_host_id, |
| 211 get<0>(param).shared_memory_handle); |
| 211 } | 212 } |
| 212 | 213 |
| 213 void RenderFrameProxy::OnDisownOpener() { | 214 void RenderFrameProxy::OnDisownOpener() { |
| 214 // TODO(creis): We should only see this for main frames for now. To support | 215 // TODO(creis): We should only see this for main frames for now. To support |
| 215 // disowning the opener on subframes, we will need to move WebContentsImpl's | 216 // disowning the opener on subframes, we will need to move WebContentsImpl's |
| 216 // opener_ to FrameTreeNode. | 217 // opener_ to FrameTreeNode. |
| 217 CHECK(!web_frame_->parent()); | 218 CHECK(!web_frame_->parent()); |
| 218 | 219 |
| 219 // When there is a RenderFrame for this proxy, tell it to disown its opener. | 220 // When there is a RenderFrame for this proxy, tell it to disown its opener. |
| 220 // TODO(creis): Remove this when we only have WebRemoteFrames and make sure | 221 // TODO(creis): Remove this when we only have WebRemoteFrames and make sure |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 blink::WebUserGestureIndicator::isProcessingUserGesture(); | 316 blink::WebUserGestureIndicator::isProcessingUserGesture(); |
| 316 blink::WebUserGestureIndicator::consumeUserGesture(); | 317 blink::WebUserGestureIndicator::consumeUserGesture(); |
| 317 Send(new FrameHostMsg_OpenURL(routing_id_, params)); | 318 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
| 318 } | 319 } |
| 319 | 320 |
| 320 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { | 321 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { |
| 321 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); | 322 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); |
| 322 } | 323 } |
| 323 | 324 |
| 324 } // namespace | 325 } // namespace |
| OLD | NEW |