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

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

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
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.h ('k') | content/common/gpu/client/gpu_memory_buffer_impl.cc » ('j') | 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.h
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl.h b/content/common/gpu/client/gpu_memory_buffer_impl.h
index 2da6b437e8ac60d44a70e441632fafb29918cfc8..ea49d2bdb97b3e48f929636a55360df2cb8ffcea 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl.h
+++ b/content/common/gpu/client/gpu_memory_buffer_impl.h
@@ -19,6 +19,7 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
CreationCallback;
typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)>
AllocationCallback;
+ typedef base::Closure DestructionCallback;
virtual ~GpuMemoryBufferImpl();
@@ -46,11 +47,14 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
base::ProcessHandle child_process);
// Creates an instance from the given |handle|. |size| and |internalformat|
- // should match what was used to allocate the |handle|.
+ // should match what was used to allocate the |handle|. |callback| is
+ // called when instance is deleted, which is not necessarily on the same
+ // thread as this function was called on and instance was created on.
static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle(
const gfx::GpuMemoryBufferHandle& handle,
const gfx::Size& size,
- unsigned internalformat);
+ unsigned internalformat,
+ const DestructionCallback& callback);
// Returns true if |internalformat| is a format recognized by this base class.
static bool IsFormatValid(unsigned internalformat);
@@ -66,10 +70,13 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
virtual bool IsMapped() const OVERRIDE;
protected:
- GpuMemoryBufferImpl(const gfx::Size& size, unsigned internalformat);
+ GpuMemoryBufferImpl(const gfx::Size& size,
+ unsigned internalformat,
+ const DestructionCallback& callback);
const gfx::Size size_;
const unsigned internalformat_;
+ const DestructionCallback callback_;
bool mapped_;
DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl);
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.h ('k') | content/common/gpu/client/gpu_memory_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698