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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // message may arrive after the frame was removed from the frame tree, but | 239 // message may arrive after the frame was removed from the frame tree, but |
240 // before the frame has been destroyed. http://crbug.com/446575. | 240 // before the frame has been destroyed. http://crbug.com/446575. |
241 if (!web_frame()->parent()) | 241 if (!web_frame()->parent()) |
242 return; | 242 return; |
243 | 243 |
244 FrameMsg_CompositorFrameSwapped::Param param; | 244 FrameMsg_CompositorFrameSwapped::Param param; |
245 if (!FrameMsg_CompositorFrameSwapped::Read(&message, ¶m)) | 245 if (!FrameMsg_CompositorFrameSwapped::Read(&message, ¶m)) |
246 return; | 246 return; |
247 | 247 |
248 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 248 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
249 get<0>(param).frame.AssignTo(frame.get()); | 249 base::get<0>(param).frame.AssignTo(frame.get()); |
250 | 250 |
251 if (!compositing_helper_.get()) { | 251 if (!compositing_helper_.get()) { |
252 compositing_helper_ = | 252 compositing_helper_ = |
253 ChildFrameCompositingHelper::CreateForRenderFrameProxy(this); | 253 ChildFrameCompositingHelper::CreateForRenderFrameProxy(this); |
254 compositing_helper_->EnableCompositing(true); | 254 compositing_helper_->EnableCompositing(true); |
255 } | 255 } |
256 compositing_helper_->OnCompositorFrameSwapped( | 256 compositing_helper_->OnCompositorFrameSwapped( |
257 frame.Pass(), | 257 frame.Pass(), |
258 get<0>(param).producing_route_id, | 258 base::get<0>(param).producing_route_id, |
259 get<0>(param).output_surface_id, | 259 base::get<0>(param).output_surface_id, |
260 get<0>(param).producing_host_id, | 260 base::get<0>(param).producing_host_id, |
261 get<0>(param).shared_memory_handle); | 261 base::get<0>(param).shared_memory_handle); |
262 } | 262 } |
263 | 263 |
264 void RenderFrameProxy::OnDisownOpener() { | 264 void RenderFrameProxy::OnDisownOpener() { |
265 // TODO(creis): We should only see this for main frames for now. To support | 265 // TODO(creis): We should only see this for main frames for now. To support |
266 // disowning the opener on subframes, we will need to move WebContentsImpl's | 266 // disowning the opener on subframes, we will need to move WebContentsImpl's |
267 // opener_ to FrameTreeNode. | 267 // opener_ to FrameTreeNode. |
268 CHECK(!web_frame_->parent()); | 268 CHECK(!web_frame_->parent()); |
269 | 269 |
270 // When there is a RenderFrame for this proxy, tell it to disown its opener. | 270 // When there is a RenderFrame for this proxy, tell it to disown its opener. |
271 // TODO(creis): Remove this when we only have WebRemoteFrames and make sure | 271 // TODO(creis): Remove this when we only have WebRemoteFrames and make sure |
(...skipping 112 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 |