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

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

Issue 595063004: content: Fix OOM error handling in GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildPro… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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_shared_memory.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc b/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
index 4c1534db191be9824d9603454e1fd2e762f06936..bcbdd9f28fe6a87b1eedd13a19102cf8c9986fe2 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
@@ -43,13 +43,13 @@ void GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess(
base::ProcessHandle child_process,
const AllocationCallback& callback) {
DCHECK(IsLayoutSupported(size, internalformat));
- gfx::GpuMemoryBufferHandle handle;
base::SharedMemory shared_memory;
if (!shared_memory.CreateAnonymous(size.GetArea() *
BytesPerPixel(internalformat))) {
- handle.type = gfx::EMPTY_BUFFER;
+ callback.Run(gfx::GpuMemoryBufferHandle());
return;
}
+ gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::SHARED_MEMORY_BUFFER;
shared_memory.GiveToProcess(child_process, &handle.handle);
callback.Run(handle);
« 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