Chromium Code Reviews| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 | 274 |
| 275 void RenderWidgetHostViewGuest::SendSurfaceInfoToEmbedderImpl( | 275 void RenderWidgetHostViewGuest::SendSurfaceInfoToEmbedderImpl( |
| 276 const cc::SurfaceInfo& surface_info, | 276 const cc::SurfaceInfo& surface_info, |
| 277 const cc::SurfaceSequence& sequence) { | 277 const cc::SurfaceSequence& sequence) { |
| 278 if (guest_ && !guest_->is_in_destruction()) | 278 if (guest_ && !guest_->is_in_destruction()) |
| 279 guest_->SetChildFrameSurface(surface_info, sequence); | 279 guest_->SetChildFrameSurface(surface_info, sequence); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void RenderWidgetHostViewGuest::OnSwapCompositorFrame( | 282 void RenderWidgetHostViewGuest::OnSwapCompositorFrame( |
| 283 uint32_t compositor_frame_sink_id, | 283 uint32_t compositor_frame_sink_id, |
| 284 cc::LocalSurfaceId local_surface_id, | |
|
Fady Samuel
2017/03/15 12:05:47
const cc::LocalSurfaceId&
Saman Sami
2017/03/16 18:33:07
Done.
| |
| 284 cc::CompositorFrame frame) { | 285 cc::CompositorFrame frame) { |
| 285 TRACE_EVENT0("content", "RenderWidgetHostViewGuest::OnSwapCompositorFrame"); | 286 TRACE_EVENT0("content", "RenderWidgetHostViewGuest::OnSwapCompositorFrame"); |
| 286 | 287 |
| 287 last_scroll_offset_ = frame.metadata.root_scroll_offset; | 288 last_scroll_offset_ = frame.metadata.root_scroll_offset; |
| 288 ProcessCompositorFrame(compositor_frame_sink_id, std::move(frame)); | 289 ProcessCompositorFrame(compositor_frame_sink_id, local_surface_id, |
| 290 std::move(frame)); | |
| 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 } |
| 296 | 298 |
| 297 bool RenderWidgetHostViewGuest::OnMessageReceived(const IPC::Message& msg) { | 299 bool RenderWidgetHostViewGuest::OnMessageReceived(const IPC::Message& msg) { |
| 298 if (!platform_view_) { | 300 if (!platform_view_) { |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 host_->ForwardGestureEvent(gesture_event); | 638 host_->ForwardGestureEvent(gesture_event); |
| 637 return; | 639 return; |
| 638 } | 640 } |
| 639 } | 641 } |
| 640 | 642 |
| 641 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { | 643 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { |
| 642 return guest_ && guest_->has_attached_since_surface_set(); | 644 return guest_ && guest_->has_attached_since_surface_set(); |
| 643 } | 645 } |
| 644 | 646 |
| 645 } // namespace content | 647 } // namespace content |
| OLD | NEW |