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/browser/frame_host/render_widget_host_view_guest.h" | 5 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 guest_->SetChildFrameSurface(surface_id_, frame_size, scale_factor, | 275 guest_->SetChildFrameSurface(surface_id_, frame_size, scale_factor, |
276 sequence); | 276 sequence); |
277 } | 277 } |
278 | 278 |
279 cc::SurfaceFactory::DrawCallback ack_callback = base::Bind( | 279 cc::SurfaceFactory::DrawCallback ack_callback = base::Bind( |
280 &RenderWidgetHostViewChildFrame::SurfaceDrawn, | 280 &RenderWidgetHostViewChildFrame::SurfaceDrawn, |
281 RenderWidgetHostViewChildFrame::AsWeakPtr(), output_surface_id); | 281 RenderWidgetHostViewChildFrame::AsWeakPtr(), output_surface_id); |
282 ack_pending_count_++; | 282 ack_pending_count_++; |
283 // If this value grows very large, something is going wrong. | 283 // If this value grows very large, something is going wrong. |
284 DCHECK(ack_pending_count_ < 1000); | 284 DCHECK(ack_pending_count_ < 1000); |
285 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame), | 285 std::unique_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame); |
| 286 *frame_copy = std::move(frame); |
| 287 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame_copy), |
286 ack_callback); | 288 ack_callback); |
287 | 289 |
288 ProcessFrameSwappedCallbacks(); | 290 ProcessFrameSwappedCallbacks(); |
289 | 291 |
290 // If after detaching we are sent a frame, we should finish processing it, and | 292 // If after detaching we are sent a frame, we should finish processing it, and |
291 // then we should clear the surface so that we are not holding resources we | 293 // then we should clear the surface so that we are not holding resources we |
292 // no longer need. | 294 // no longer need. |
293 if (!guest_ || !guest_->attached()) | 295 if (!guest_ || !guest_->attached()) |
294 ClearCompositorSurfaceIfNecessary(); | 296 ClearCompositorSurfaceIfNecessary(); |
295 } | 297 } |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 gesture_event.data.scrollUpdate.inertialPhase == | 594 gesture_event.data.scrollUpdate.inertialPhase == |
593 blink::WebGestureEvent::MomentumPhase) { | 595 blink::WebGestureEvent::MomentumPhase) { |
594 return; | 596 return; |
595 } | 597 } |
596 host_->ForwardGestureEvent(gesture_event); | 598 host_->ForwardGestureEvent(gesture_event); |
597 return; | 599 return; |
598 } | 600 } |
599 } | 601 } |
600 | 602 |
601 } // namespace content | 603 } // namespace content |
OLD | NEW |