| 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 679 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
| 680 return cc::SurfaceId(frame_sink_id_, local_surface_id_); | 680 return cc::SurfaceId(frame_sink_id_, local_surface_id_); |
| 681 }; | 681 }; |
| 682 | 682 |
| 683 void RenderWidgetHostViewChildFrame::CreateCompositorFrameSinkSupport() { | 683 void RenderWidgetHostViewChildFrame::CreateCompositorFrameSinkSupport() { |
| 684 DCHECK(!support_); | 684 DCHECK(!support_); |
| 685 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( | 685 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( |
| 686 this, GetSurfaceManager(), frame_sink_id_, false /* is_root */, | 686 this, GetSurfaceManager(), frame_sink_id_, false /* is_root */, |
| 687 false /* handles_frame_sink_id_invalidation */, | 687 false /* handles_frame_sink_id_invalidation */, |
| 688 true /* needs_sync_points */); | 688 true /* needs_sync_points */); |
| 689 support_->Init(); |
| 689 if (parent_frame_sink_id_.is_valid()) { | 690 if (parent_frame_sink_id_.is_valid()) { |
| 690 GetSurfaceManager()->RegisterFrameSinkHierarchy(parent_frame_sink_id_, | 691 GetSurfaceManager()->RegisterFrameSinkHierarchy(parent_frame_sink_id_, |
| 691 frame_sink_id_); | 692 frame_sink_id_); |
| 692 } | 693 } |
| 693 if (host_->needs_begin_frames()) | 694 if (host_->needs_begin_frames()) |
| 694 support_->SetNeedsBeginFrame(true); | 695 support_->SetNeedsBeginFrame(true); |
| 695 } | 696 } |
| 696 | 697 |
| 697 void RenderWidgetHostViewChildFrame::ResetCompositorFrameSinkSupport() { | 698 void RenderWidgetHostViewChildFrame::ResetCompositorFrameSinkSupport() { |
| 698 if (!support_) | 699 if (!support_) |
| 699 return; | 700 return; |
| 700 if (parent_frame_sink_id_.is_valid()) { | 701 if (parent_frame_sink_id_.is_valid()) { |
| 701 GetSurfaceManager()->UnregisterFrameSinkHierarchy(parent_frame_sink_id_, | 702 GetSurfaceManager()->UnregisterFrameSinkHierarchy(parent_frame_sink_id_, |
| 702 frame_sink_id_); | 703 frame_sink_id_); |
| 703 } | 704 } |
| 704 support_.reset(); | 705 support_.reset(); |
| 705 } | 706 } |
| 706 | 707 |
| 707 bool RenderWidgetHostViewChildFrame::HasEmbedderChanged() { | 708 bool RenderWidgetHostViewChildFrame::HasEmbedderChanged() { |
| 708 return false; | 709 return false; |
| 709 } | 710 } |
| 710 | 711 |
| 711 } // namespace content | 712 } // namespace content |
| OLD | NEW |