| 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_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { | 682 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { |
| 683 return true; | 683 return true; |
| 684 } | 684 } |
| 685 | 685 |
| 686 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 686 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
| 687 return cc::SurfaceId(frame_sink_id_, local_surface_id_); | 687 return cc::SurfaceId(frame_sink_id_, local_surface_id_); |
| 688 }; | 688 }; |
| 689 | 689 |
| 690 void RenderWidgetHostViewChildFrame::CreateCompositorFrameSinkSupport() { | 690 void RenderWidgetHostViewChildFrame::CreateCompositorFrameSinkSupport() { |
| 691 DCHECK(!support_); | 691 DCHECK(!support_); |
| 692 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( | 692 constexpr bool is_root = false; |
| 693 this, GetSurfaceManager(), frame_sink_id_, false /* is_root */, | 693 constexpr bool handles_frame_sink_id_invalidation = false; |
| 694 false /* handles_frame_sink_id_invalidation */, | 694 constexpr bool needs_sync_points = true; |
| 695 true /* needs_sync_points */); | 695 support_ = cc::CompositorFrameSinkSupport::Create( |
| 696 this, GetSurfaceManager(), frame_sink_id_, is_root, |
| 697 handles_frame_sink_id_invalidation, needs_sync_points); |
| 696 if (parent_frame_sink_id_.is_valid()) { | 698 if (parent_frame_sink_id_.is_valid()) { |
| 697 GetSurfaceManager()->RegisterFrameSinkHierarchy(parent_frame_sink_id_, | 699 GetSurfaceManager()->RegisterFrameSinkHierarchy(parent_frame_sink_id_, |
| 698 frame_sink_id_); | 700 frame_sink_id_); |
| 699 } | 701 } |
| 700 if (host_->needs_begin_frames()) | 702 if (host_->needs_begin_frames()) |
| 701 support_->SetNeedsBeginFrame(true); | 703 support_->SetNeedsBeginFrame(true); |
| 702 } | 704 } |
| 703 | 705 |
| 704 void RenderWidgetHostViewChildFrame::ResetCompositorFrameSinkSupport() { | 706 void RenderWidgetHostViewChildFrame::ResetCompositorFrameSinkSupport() { |
| 705 if (!support_) | 707 if (!support_) |
| 706 return; | 708 return; |
| 707 if (parent_frame_sink_id_.is_valid()) { | 709 if (parent_frame_sink_id_.is_valid()) { |
| 708 GetSurfaceManager()->UnregisterFrameSinkHierarchy(parent_frame_sink_id_, | 710 GetSurfaceManager()->UnregisterFrameSinkHierarchy(parent_frame_sink_id_, |
| 709 frame_sink_id_); | 711 frame_sink_id_); |
| 710 } | 712 } |
| 711 support_.reset(); | 713 support_.reset(); |
| 712 } | 714 } |
| 713 | 715 |
| 714 bool RenderWidgetHostViewChildFrame::HasEmbedderChanged() { | 716 bool RenderWidgetHostViewChildFrame::HasEmbedderChanged() { |
| 715 return false; | 717 return false; |
| 716 } | 718 } |
| 717 | 719 |
| 718 } // namespace content | 720 } // namespace content |
| OLD | NEW |