Index: content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc |
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc |
index 35e08c99308b44bfab62fb0e1473945eceaca92e..56113168958c70b91c6b7c0dd4f4bc3577956139 100644 |
--- a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc |
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc |
@@ -25,8 +25,12 @@ void GpuMemoryBufferCreated( |
gfx::GpuMemoryBuffer::Format format, |
const GpuMemoryBufferImpl::CreationCallback& callback, |
const gfx::GpuMemoryBufferHandle& handle) { |
- DCHECK_EQ(gfx::OZONE_NATIVE_BUFFER, handle.type); |
+ if (handle.is_null()) { |
+ callback.Run(scoped_ptr<GpuMemoryBufferImpl>()); |
+ return; |
+ } |
+ DCHECK_EQ(gfx::OZONE_NATIVE_BUFFER, handle.type); |
callback.Run(GpuMemoryBufferImplOzoneNativeBuffer::CreateFromHandle( |
handle, size, format, base::Bind(&GpuMemoryBufferDeleted, handle))); |
} |
@@ -34,7 +38,7 @@ void GpuMemoryBufferCreated( |
void GpuMemoryBufferCreatedForChildProcess( |
const GpuMemoryBufferImpl::AllocationCallback& callback, |
const gfx::GpuMemoryBufferHandle& handle) { |
- DCHECK_EQ(gfx::OZONE_NATIVE_BUFFER, handle.type); |
+ DCHECK_IMPLIES(!handle.is_null(), gfx::OZONE_NATIVE_BUFFER == handle.type); |
callback.Run(handle); |
} |