| 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 #ifndef CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_ | 6 #define CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "content/common/android/surface_texture_manager.h" | 8 #include "content/common/android/surface_texture_manager.h" |
| 9 | 9 |
| 10 #include "base/memory/singleton.h" |
| 10 #include "content/common/android/surface_texture_peer.h" | 11 #include "content/common/android/surface_texture_peer.h" |
| 12 #include "content/common/content_export.h" |
| 11 | 13 |
| 12 namespace content { | 14 namespace content { |
| 13 | 15 |
| 14 class BrowserSurfaceTextureManager : public SurfaceTextureManager, | 16 class CONTENT_EXPORT BrowserSurfaceTextureManager |
| 15 public SurfaceTexturePeer { | 17 : public SurfaceTextureManager, |
| 18 public SurfaceTexturePeer { |
| 16 public: | 19 public: |
| 17 BrowserSurfaceTextureManager(); | 20 static BrowserSurfaceTextureManager* GetInstance(); |
| 18 ~BrowserSurfaceTextureManager() override; | |
| 19 | 21 |
| 20 // Overridden from SurfaceTextureManager: | 22 // Overridden from SurfaceTextureManager: |
| 21 void RegisterSurfaceTexture(int surface_texture_id, | 23 void RegisterSurfaceTexture(int surface_texture_id, |
| 22 int client_id, | 24 int client_id, |
| 23 gfx::SurfaceTexture* surface_texture) override; | 25 gfx::SurfaceTexture* surface_texture) override; |
| 24 void UnregisterSurfaceTexture(int surface_texture_id, int client_id) override; | 26 void UnregisterSurfaceTexture(int surface_texture_id, int client_id) override; |
| 25 gfx::AcceleratedWidget AcquireNativeWidgetForSurfaceTexture( | 27 gfx::AcceleratedWidget AcquireNativeWidgetForSurfaceTexture( |
| 26 int surface_texture_id) override; | 28 int surface_texture_id) override; |
| 27 | 29 |
| 28 // Overridden from SurfaceTexturePeer: | 30 // Overridden from SurfaceTexturePeer: |
| 29 void EstablishSurfaceTexturePeer( | 31 void EstablishSurfaceTexturePeer( |
| 30 base::ProcessHandle render_process_handle, | 32 base::ProcessHandle render_process_handle, |
| 31 scoped_refptr<gfx::SurfaceTexture> surface_texture, | 33 scoped_refptr<gfx::SurfaceTexture> surface_texture, |
| 32 int render_frame_id, | 34 int render_frame_id, |
| 33 int player_id) override; | 35 int player_id) override; |
| 34 | 36 |
| 35 private: | 37 private: |
| 38 friend struct DefaultSingletonTraits<BrowserSurfaceTextureManager>; |
| 39 |
| 40 BrowserSurfaceTextureManager(); |
| 41 ~BrowserSurfaceTextureManager() override; |
| 42 |
| 36 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceTextureManager); | 43 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceTextureManager); |
| 37 }; | 44 }; |
| 38 | 45 |
| 39 } // namespace content | 46 } // namespace content |
| 40 | 47 |
| 41 #endif // CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_ | 48 #endif // CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_ |
| OLD | NEW |