Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_provider_impl.cc

Issue 2737653005: Rename OffscreenCanvasSurfaceManager to OffscreenCanvasCompositorFrameSinkManager (Closed)
Patch Set: Format header Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_p rovider_impl.h" 5 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p rovider_impl.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "content/browser/compositor/surface_utils.h" 8 #include "content/browser/compositor/surface_utils.h"
9 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h " 9 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h "
10 #include "content/browser/renderer_host/offscreen_canvas_surface_manager.h" 10 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_m anager.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 OffscreenCanvasCompositorFrameSinkProviderImpl:: 15 OffscreenCanvasCompositorFrameSinkProviderImpl::
16 OffscreenCanvasCompositorFrameSinkProviderImpl() {} 16 OffscreenCanvasCompositorFrameSinkProviderImpl() {}
17 17
18 OffscreenCanvasCompositorFrameSinkProviderImpl:: 18 OffscreenCanvasCompositorFrameSinkProviderImpl::
19 ~OffscreenCanvasCompositorFrameSinkProviderImpl() {} 19 ~OffscreenCanvasCompositorFrameSinkProviderImpl() {}
20 20
21 void OffscreenCanvasCompositorFrameSinkProviderImpl::Add( 21 void OffscreenCanvasCompositorFrameSinkProviderImpl::Add(
22 blink::mojom::OffscreenCanvasCompositorFrameSinkProviderRequest request) { 22 blink::mojom::OffscreenCanvasCompositorFrameSinkProviderRequest request) {
23 bindings_.AddBinding(this, std::move(request)); 23 bindings_.AddBinding(this, std::move(request));
24 } 24 }
25 25
26 void OffscreenCanvasCompositorFrameSinkProviderImpl::CreateCompositorFrameSink( 26 void OffscreenCanvasCompositorFrameSinkProviderImpl::CreateCompositorFrameSink(
27 const cc::FrameSinkId& frame_sink_id, 27 const cc::FrameSinkId& frame_sink_id,
28 cc::mojom::MojoCompositorFrameSinkClientPtr client, 28 cc::mojom::MojoCompositorFrameSinkClientPtr client,
29 cc::mojom::MojoCompositorFrameSinkRequest request) { 29 cc::mojom::MojoCompositorFrameSinkRequest request) {
30 compositor_frame_sinks_[frame_sink_id] = 30 compositor_frame_sinks_[frame_sink_id] =
31 base::MakeUnique<OffscreenCanvasCompositorFrameSink>( 31 base::MakeUnique<OffscreenCanvasCompositorFrameSink>(
32 this, frame_sink_id, std::move(request), std::move(client)); 32 this, frame_sink_id, std::move(request), std::move(client));
33 33
34 OffscreenCanvasSurfaceManager::GetInstance()->RegisterFrameSinkToParent( 34 OffscreenCanvasCompositorFrameSinkManager::GetInstance()
35 frame_sink_id); 35 ->RegisterFrameSinkToParent(frame_sink_id);
36 } 36 }
37 37
38 cc::SurfaceManager* 38 cc::SurfaceManager*
39 OffscreenCanvasCompositorFrameSinkProviderImpl::GetSurfaceManager() { 39 OffscreenCanvasCompositorFrameSinkProviderImpl::GetSurfaceManager() {
40 return content::GetSurfaceManager(); 40 return content::GetSurfaceManager();
41 } 41 }
42 42
43 void OffscreenCanvasCompositorFrameSinkProviderImpl:: 43 void OffscreenCanvasCompositorFrameSinkProviderImpl::
44 OnCompositorFrameSinkClientConnectionLost( 44 OnCompositorFrameSinkClientConnectionLost(
45 const cc::FrameSinkId& frame_sink_id) { 45 const cc::FrameSinkId& frame_sink_id) {
46 // TODO(fsamuel, xlai): Investigate why this function is not fired when user 46 // TODO(fsamuel, xlai): Investigate why this function is not fired when user
47 // close down the window that has OffscreenCanvas commit(). 47 // close down the window that has OffscreenCanvas commit().
48 compositor_frame_sinks_.erase(frame_sink_id); 48 compositor_frame_sinks_.erase(frame_sink_id);
49 } 49 }
50 50
51 void OffscreenCanvasCompositorFrameSinkProviderImpl:: 51 void OffscreenCanvasCompositorFrameSinkProviderImpl::
52 OnCompositorFrameSinkClientDestroyed(const cc::FrameSinkId& frame_sink_id) { 52 OnCompositorFrameSinkClientDestroyed(const cc::FrameSinkId& frame_sink_id) {
53 OffscreenCanvasSurfaceManager::GetInstance()->UnregisterFrameSinkFromParent( 53 OffscreenCanvasCompositorFrameSinkManager::GetInstance()
54 frame_sink_id); 54 ->UnregisterFrameSinkFromParent(frame_sink_id);
55 } 55 }
56 56
57 } // namespace content 57 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698