Chromium Code Reviews| Index: content/common/gpu/gpu_memory_buffer_factory_io_surface.cc |
| diff --git a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc |
| index f8a74d626e63c047b934b34e51e9d22825b0da37..5db66aa2cac1d6f8d17fad6b41056198d47bf18d 100644 |
| --- a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc |
| +++ b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc |
| @@ -50,13 +50,12 @@ GpuMemoryBufferFactoryIOSurface::CreateGpuMemoryBuffer( |
| gfx::PluginWindowHandle surface_handle) { |
| base::ScopedCFTypeRef<IOSurfaceRef> io_surface( |
| gfx::IOSurfaceManager::CreateIOSurface(size, format)); |
| - if (!io_surface) |
| - return gfx::GpuMemoryBufferHandle(); |
| + CHECK(io_surface); |
|
reveman
2015/12/01 20:49:04
This makes it possible for a malicious renderer to
|
| - if (!gfx::IOSurfaceManager::GetInstance()->RegisterIOSurface(id, client_id, |
| - io_surface)) { |
| - return gfx::GpuMemoryBufferHandle(); |
| - } |
| + bool register_result = |
| + gfx::IOSurfaceManager::GetInstance()->RegisterIOSurface(id, client_id, |
| + io_surface); |
| + CHECK(register_result); |
|
reveman
2015/12/01 20:49:04
Is it possible that the browser decides to start a
|
| { |
| base::AutoLock lock(io_surfaces_lock_); |