Index: content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc |
diff --git a/content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc b/content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc |
index 1b2c881f6aeb2e5420e57cd9e5bf68eb4672e543..be755302b22b6f3c633485d92fc48532f047aca8 100644 |
--- a/content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc |
+++ b/content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc |
@@ -51,6 +51,7 @@ GpuMemoryBufferFactorySurfaceTexture::CreateGpuMemoryBuffer( |
gfx::GpuMemoryBuffer::Usage usage, |
int client_id, |
gfx::PluginWindowHandle surface_handle) { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
// Note: this needs to be 0 as the surface texture implemenation will take |
// ownership of the texture and call glDeleteTextures when the GPU service |
// attaches the surface texture to a real texture id. glDeleteTextures |
@@ -64,13 +65,9 @@ GpuMemoryBufferFactorySurfaceTexture::CreateGpuMemoryBuffer( |
SurfaceTextureManager::GetInstance()->RegisterSurfaceTexture( |
id, client_id, surface_texture.get()); |
- { |
- base::AutoLock lock(surface_textures_lock_); |
- |
- SurfaceTextureMapKey key(id, client_id); |
- DCHECK(surface_textures_.find(key) == surface_textures_.end()); |
- surface_textures_[key] = surface_texture; |
- } |
+ SurfaceTextureMapKey key(id, client_id); |
+ DCHECK(surface_textures_.find(key) == surface_textures_.end()); |
+ surface_textures_[key] = surface_texture; |
gfx::GpuMemoryBufferHandle handle; |
handle.type = gfx::SURFACE_TEXTURE_BUFFER; |
@@ -81,14 +78,11 @@ GpuMemoryBufferFactorySurfaceTexture::CreateGpuMemoryBuffer( |
void GpuMemoryBufferFactorySurfaceTexture::DestroyGpuMemoryBuffer( |
gfx::GpuMemoryBufferId id, |
int client_id) { |
- { |
- base::AutoLock lock(surface_textures_lock_); |
- |
- SurfaceTextureMapKey key(id, client_id); |
- SurfaceTextureMap::iterator it = surface_textures_.find(key); |
- if (it != surface_textures_.end()) |
- surface_textures_.erase(it); |
- } |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ SurfaceTextureMapKey key(id, client_id); |
+ SurfaceTextureMap::iterator it = surface_textures_.find(key); |
+ if (it != surface_textures_.end()) |
+ surface_textures_.erase(it); |
SurfaceTextureManager::GetInstance()->UnregisterSurfaceTexture(id, client_id); |
} |
@@ -104,8 +98,7 @@ GpuMemoryBufferFactorySurfaceTexture::CreateImageForGpuMemoryBuffer( |
gfx::GpuMemoryBuffer::Format format, |
unsigned internalformat, |
int client_id) { |
- base::AutoLock lock(surface_textures_lock_); |
- |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
DCHECK_EQ(handle.type, gfx::SURFACE_TEXTURE_BUFFER); |
SurfaceTextureMapKey key(handle.id, client_id); |