| OLD | NEW | 
|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/renderer_host/offscreen_canvas_compositor_frame_sink.h
    " | 5 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h
    " | 
| 6 | 6 | 
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" | 
| 8 #include "cc/surfaces/surface.h" | 8 #include "cc/surfaces/surface.h" | 
| 9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" | 
| 10 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p
    rovider_impl.h" | 10 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p
    rovider_impl.h" | 
| 11 #include "mojo/public/cpp/bindings/strong_binding.h" | 11 #include "mojo/public/cpp/bindings/strong_binding.h" | 
| 12 | 12 | 
| 13 namespace content { | 13 namespace content { | 
| 14 | 14 | 
| 15 OffscreenCanvasCompositorFrameSink::OffscreenCanvasCompositorFrameSink( | 15 OffscreenCanvasCompositorFrameSink::OffscreenCanvasCompositorFrameSink( | 
| 16     OffscreenCanvasCompositorFrameSinkProviderImpl* provider, | 16     OffscreenCanvasCompositorFrameSinkProviderImpl* provider, | 
| 17     const cc::FrameSinkId& frame_sink_id, | 17     const cc::FrameSinkId& frame_sink_id, | 
| 18     cc::mojom::MojoCompositorFrameSinkRequest request, | 18     cc::mojom::MojoCompositorFrameSinkRequest request, | 
| 19     cc::mojom::MojoCompositorFrameSinkClientPtr client) | 19     cc::mojom::MojoCompositorFrameSinkClientPtr client) | 
| 20     : provider_(provider), | 20     : provider_(provider), | 
| 21       support_(this, | 21       support_(this, | 
| 22                provider->GetSurfaceManager(), | 22                provider->GetSurfaceManager(), | 
| 23                frame_sink_id, | 23                frame_sink_id, | 
| 24                nullptr, | 24                nullptr, | 
| 25                true /* handles_frame_sink_id_invalidation */, | 25                nullptr), | 
| 26                true /* needs_sync_points */), |  | 
| 27       client_(std::move(client)), | 26       client_(std::move(client)), | 
| 28       binding_(this, std::move(request)) { | 27       binding_(this, std::move(request)) { | 
| 29   binding_.set_connection_error_handler( | 28   binding_.set_connection_error_handler( | 
| 30       base::Bind(&OffscreenCanvasCompositorFrameSink::OnClientConnectionLost, | 29       base::Bind(&OffscreenCanvasCompositorFrameSink::OnClientConnectionLost, | 
| 31                  base::Unretained(this))); | 30                  base::Unretained(this))); | 
| 32 } | 31 } | 
| 33 | 32 | 
| 34 OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() { | 33 OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() { | 
| 35   provider_->OnCompositorFrameSinkClientDestroyed(support_.frame_sink_id()); | 34   provider_->OnCompositorFrameSinkClientDestroyed(support_.frame_sink_id()); | 
| 36 } | 35 } | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 84   if (client_) | 83   if (client_) | 
| 85     client_->WillDrawSurface(); | 84     client_->WillDrawSurface(); | 
| 86 } | 85 } | 
| 87 | 86 | 
| 88 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { | 87 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { | 
| 89   provider_->OnCompositorFrameSinkClientConnectionLost( | 88   provider_->OnCompositorFrameSinkClientConnectionLost( | 
| 90       support_.frame_sink_id()); | 89       support_.frame_sink_id()); | 
| 91 } | 90 } | 
| 92 | 91 | 
| 93 }  // namespace content | 92 }  // namespace content | 
| OLD | NEW | 
|---|