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

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

Issue 263553009: content: Cleanup GpuMemoryBuffer allocation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove use of ChildProcessHostImpl and use base::CheckedNumeric Created 6 years, 8 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.h
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_shm.h b/content/common/gpu/client/gpu_memory_buffer_impl_shm.h
index 6e0856306bbfb96a5a034f96b37d4fb15fbfe8e2..e11a710241be088429743c6411695bd0f5bc3c72 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_shm.h
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_shm.h
@@ -9,15 +9,22 @@
namespace content {
-// Provides implementation of a GPU memory buffer based
-// on a shared memory handle.
+// Implementation of GPU memory buffer based on shared memory.
class GpuMemoryBufferImplShm : public GpuMemoryBufferImpl {
public:
- GpuMemoryBufferImplShm(gfx::Size size, unsigned internalformat);
+ GpuMemoryBufferImplShm(const gfx::Size& size, unsigned internalformat);
virtual ~GpuMemoryBufferImplShm();
- bool Initialize(gfx::GpuMemoryBufferHandle handle);
- bool InitializeFromSharedMemory(scoped_ptr<base::SharedMemory> shared_memory);
+ // Allocates a shared memory backed GPU memory buffer with |size| and
+ // |internalformat| for use by |child_process|.
+ static void AllocateSharedMemoryForChildProcess(
+ const gfx::Size& size,
+ unsigned internalformat,
+ base::ProcessHandle child_process,
+ gfx::GpuMemoryBufferHandle* handle);
+
+ bool Initialize();
+ bool InitializeFromHandle(gfx::GpuMemoryBufferHandle handle);
// Overridden from gfx::GpuMemoryBuffer:
virtual void* Map(AccessMode mode) OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698