Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl.cc

Issue 1503393005: Check that shared memory GpuMemoryBuffer opening succeeds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/gpu_memory_buffer_impl.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl.cc b/content/common/gpu/client/gpu_memory_buffer_impl.cc
index e900829fda34756318a7a21ab8f7d4d55b8ffb51..072b9bc5be3861374d2c18fc6c6ffcb51402d6e7 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl.cc
@@ -44,9 +44,13 @@ scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle(
gfx::BufferUsage usage,
const DestructionCallback& callback) {
switch (handle.type) {
- case gfx::SHARED_MEMORY_BUFFER:
- return GpuMemoryBufferImplSharedMemory::CreateFromHandle(
- handle, size, format, usage, callback);
+ case gfx::SHARED_MEMORY_BUFFER: {
+ scoped_ptr<GpuMemoryBufferImpl> buffer =
+ GpuMemoryBufferImplSharedMemory::CreateFromHandle(
+ handle, size, format, usage, callback);
+ CHECK(buffer);
reveman 2015/12/08 18:05:50 How about changing the base::SharedMemory::IsHandl
+ return buffer.Pass();
+ }
#if defined(OS_MACOSX)
case gfx::IO_SURFACE_BUFFER:
return GpuMemoryBufferImplIOSurface::CreateFromHandle(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698