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

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

Issue 290573011: Delay the response to ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer via a callback to allow for b… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 7 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
Index: content/common/gpu/client/gpu_memory_buffer_impl_shm.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_shm.cc b/content/common/gpu/client/gpu_memory_buffer_impl_shm.cc
index a978c66bbac01c1ebbbcb920bdd78b23d7c12f22..8420931420697ffaf739e52e867358d4e0c0d1a0 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_shm.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_shm.cc
@@ -20,16 +20,18 @@ void GpuMemoryBufferImplShm::AllocateSharedMemoryForChildProcess(
const gfx::Size& size,
unsigned internalformat,
base::ProcessHandle child_process,
- gfx::GpuMemoryBufferHandle* handle) {
+ 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;
+ handle.type = gfx::EMPTY_BUFFER;
return;
}
- handle->type = gfx::SHARED_MEMORY_BUFFER;
- shared_memory.GiveToProcess(child_process, &handle->handle);
+ handle.type = gfx::SHARED_MEMORY_BUFFER;
+ shared_memory.GiveToProcess(child_process, &handle.handle);
+ callback.Run(handle);
}
// static

Powered by Google App Engine
This is Rietveld 408576698