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

Unified Diff: gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc

Issue 2448983003: gpu: Refactor memory buffer handling code out of content.
Patch Set: . Created 4 years, 1 month 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 | « gpu/ipc/client/gpu_host_memory_buffer_manager.cc ('k') | mojo/public/cpp/bindings/sync_call_restrictions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
index 2641b8bfa1635e262214f998f685d376ddcc5bc0..c6837dc5e06ff19b5d3a645ac88c97d83f416da1 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc
@@ -64,6 +64,11 @@ GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
const gfx::Size& size,
gfx::BufferFormat format,
base::ProcessHandle child_process) {
+ // TODO(sad): This should just be Allocate. The returned
+ // GpuMemoryBufferHandle::handle should be set to |shared_memory.handle()|.
+ // The caller can then decide how to share that handle with the child process
+ // (non-mojo would use GiveToProcess, and mojo would use
+ // WrapSharedMemoryHandle).
size_t buffer_size = 0u;
if (!gfx::BufferSizeForBufferFormatChecked(size, format, &buffer_size))
return gfx::GpuMemoryBufferHandle();
« no previous file with comments | « gpu/ipc/client/gpu_host_memory_buffer_manager.cc ('k') | mojo/public/cpp/bindings/sync_call_restrictions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698