| 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 | 275 |
| 276 void RenderWidgetHostViewGuest::SendSurfaceInfoToEmbedderImpl( | 276 void RenderWidgetHostViewGuest::SendSurfaceInfoToEmbedderImpl( |
| 277 const cc::SurfaceInfo& surface_info, | 277 const cc::SurfaceInfo& surface_info, |
| 278 const cc::SurfaceSequence& sequence) { | 278 const cc::SurfaceSequence& sequence) { |
| 279 if (guest_ && !guest_->is_in_destruction()) | 279 if (guest_ && !guest_->is_in_destruction()) |
| 280 guest_->SetChildFrameSurface(surface_info, sequence); | 280 guest_->SetChildFrameSurface(surface_info, sequence); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void RenderWidgetHostViewGuest::OnSwapCompositorFrame( | 283 void RenderWidgetHostViewGuest::OnSwapCompositorFrame( |
| 284 uint32_t compositor_frame_sink_id, | 284 uint32_t compositor_frame_sink_id, |
| 285 const cc::LocalSurfaceId& local_surface_id, |
| 285 cc::CompositorFrame frame) { | 286 cc::CompositorFrame frame) { |
| 286 TRACE_EVENT0("content", "RenderWidgetHostViewGuest::OnSwapCompositorFrame"); | 287 TRACE_EVENT0("content", "RenderWidgetHostViewGuest::OnSwapCompositorFrame"); |
| 287 | 288 |
| 288 last_scroll_offset_ = frame.metadata.root_scroll_offset; | 289 last_scroll_offset_ = frame.metadata.root_scroll_offset; |
| 289 ProcessCompositorFrame(compositor_frame_sink_id, std::move(frame)); | 290 ProcessCompositorFrame(compositor_frame_sink_id, local_surface_id, |
| 291 std::move(frame)); |
| 290 | 292 |
| 291 // If after detaching we are sent a frame, we should finish processing it, and | 293 // If after detaching we are sent a frame, we should finish processing it, and |
| 292 // then we should clear the surface so that we are not holding resources we | 294 // then we should clear the surface so that we are not holding resources we |
| 293 // no longer need. | 295 // no longer need. |
| 294 if (!guest_ || !guest_->attached()) | 296 if (!guest_ || !guest_->attached()) |
| 295 ClearCompositorSurfaceIfNecessary(); | 297 ClearCompositorSurfaceIfNecessary(); |
| 296 } | 298 } |
| 297 | 299 |
| 298 bool RenderWidgetHostViewGuest::OnMessageReceived(const IPC::Message& msg) { | 300 bool RenderWidgetHostViewGuest::OnMessageReceived(const IPC::Message& msg) { |
| 299 if (!platform_view_) { | 301 if (!platform_view_) { |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 host_->ForwardGestureEvent(gesture_event); | 646 host_->ForwardGestureEvent(gesture_event); |
| 645 return; | 647 return; |
| 646 } | 648 } |
| 647 } | 649 } |
| 648 | 650 |
| 649 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { | 651 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { |
| 650 return guest_ && guest_->has_attached_since_surface_set(); | 652 return guest_ && guest_->has_attached_since_surface_set(); |
| 651 } | 653 } |
| 652 | 654 |
| 653 } // namespace content | 655 } // namespace content |
| OLD | NEW |