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

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

Issue 600693002: content: Cleanup GpuMemoryBufferImpl destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove scoped_refptr<> from sender param of DeletedGpuMemoryBuffer 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
Index: content/common/gpu/client/gpu_memory_buffer_impl_linux.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_linux.cc b/content/common/gpu/client/gpu_memory_buffer_impl_linux.cc
index c197181b88036975d1b9f1f114aa65d41ca9d3b8..592920cdc01cc2c8d83f8968a3ab9b4e37a45c1d 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_linux.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_linux.cc
@@ -34,7 +34,7 @@ void GpuMemoryBufferImpl::AllocateForChildProcess(
const AllocationCallback& callback) {
if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
size, internalformat, usage)) {
- GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess(
+ GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
size, internalformat, child_process, callback);
return;
}
@@ -53,16 +53,12 @@ void GpuMemoryBufferImpl::DeletedByChildProcess(
scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
- unsigned internalformat) {
+ unsigned internalformat,
+ const DestructionCallback& callback) {
switch (handle.type) {
- case gfx::SHARED_MEMORY_BUFFER: {
- scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer(
- new GpuMemoryBufferImplSharedMemory(size, internalformat));
- if (!buffer->InitializeFromHandle(handle))
- return scoped_ptr<GpuMemoryBufferImpl>();
-
- return buffer.PassAs<GpuMemoryBufferImpl>();
- }
+ case gfx::SHARED_MEMORY_BUFFER:
+ return GpuMemoryBufferImplSharedMemory::CreateFromHandle(
+ handle, size, internalformat, callback);
default:
return scoped_ptr<GpuMemoryBufferImpl>();
}

Powered by Google App Engine
This is Rietveld 408576698