| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/android/in_process_surface_texture_manager.h" | 5 #include "content/browser/android/in_process_surface_texture_manager.h" |
| 6 | 6 |
| 7 #include <android/native_window.h> | 7 #include <android/native_window.h> |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 11 #include "base/containers/scoped_ptr_hash_map.h" | 11 #include "base/containers/scoped_ptr_hash_map.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "content/browser/media/android/browser_media_player_manager.h" | 13 #include "content/browser/media/android/browser_media_player_manager.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 // static | 18 // static |
| 19 InProcessSurfaceTextureManager* InProcessSurfaceTextureManager::GetInstance() { | 19 InProcessSurfaceTextureManager* InProcessSurfaceTextureManager::GetInstance() { |
| 20 return Singleton<InProcessSurfaceTextureManager, | 20 return base::Singleton< |
| 21 LeakySingletonTraits<InProcessSurfaceTextureManager>>::get(); | 21 InProcessSurfaceTextureManager, |
| 22 base::LeakySingletonTraits<InProcessSurfaceTextureManager>>::get(); |
| 22 } | 23 } |
| 23 | 24 |
| 24 void InProcessSurfaceTextureManager::RegisterSurfaceTexture( | 25 void InProcessSurfaceTextureManager::RegisterSurfaceTexture( |
| 25 int surface_texture_id, | 26 int surface_texture_id, |
| 26 int client_id, | 27 int client_id, |
| 27 gfx::SurfaceTexture* surface_texture) { | 28 gfx::SurfaceTexture* surface_texture) { |
| 28 base::AutoLock lock(lock_); | 29 base::AutoLock lock(lock_); |
| 29 | 30 |
| 30 DCHECK(surface_textures_.find(surface_texture_id) == surface_textures_.end()); | 31 DCHECK(surface_textures_.find(surface_texture_id) == surface_textures_.end()); |
| 31 surface_textures_.add( | 32 surface_textures_.add( |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 70 |
| 70 InProcessSurfaceTextureManager::InProcessSurfaceTextureManager() { | 71 InProcessSurfaceTextureManager::InProcessSurfaceTextureManager() { |
| 71 SurfaceTexturePeer::InitInstance(this); | 72 SurfaceTexturePeer::InitInstance(this); |
| 72 } | 73 } |
| 73 | 74 |
| 74 InProcessSurfaceTextureManager::~InProcessSurfaceTextureManager() { | 75 InProcessSurfaceTextureManager::~InProcessSurfaceTextureManager() { |
| 75 SurfaceTexturePeer::InitInstance(nullptr); | 76 SurfaceTexturePeer::InitInstance(nullptr); |
| 76 } | 77 } |
| 77 | 78 |
| 78 } // namespace content | 79 } // namespace content |
| OLD | NEW |