Index: content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc |
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc b/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc |
index 25c5b2d3517dc699a9994901dc678aad6f29c78c..91ba50d0b385ddaf14cf7c558e04da4e34b09aa1 100644 |
--- a/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc |
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc |
@@ -28,8 +28,12 @@ void GpuMemoryBufferCreated( |
gfx::GpuMemoryBuffer::Format format, |
const GpuMemoryBufferImpl::CreationCallback& callback, |
const gfx::GpuMemoryBufferHandle& handle) { |
- DCHECK_EQ(gfx::SURFACE_TEXTURE_BUFFER, handle.type); |
+ if (handle.is_null()) { |
+ callback.Run(scoped_ptr<GpuMemoryBufferImpl>()); |
+ return; |
+ } |
+ DCHECK_EQ(gfx::SURFACE_TEXTURE_BUFFER, handle.type); |
callback.Run(GpuMemoryBufferImplSurfaceTexture::CreateFromHandle( |
handle, size, format, base::Bind(&GpuMemoryBufferDeleted, handle))); |
} |
@@ -37,7 +41,7 @@ void GpuMemoryBufferCreated( |
void GpuMemoryBufferCreatedForChildProcess( |
const GpuMemoryBufferImpl::AllocationCallback& callback, |
const gfx::GpuMemoryBufferHandle& handle) { |
- DCHECK_EQ(gfx::SURFACE_TEXTURE_BUFFER, handle.type); |
+ DCHECK_IMPLIES(!handle.is_null(), gfx::SURFACE_TEXTURE_BUFFER == handle.type); |
callback.Run(handle); |
} |