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

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

Issue 600693002: content: Cleanup GpuMemoryBufferImpl destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_io_surface.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc b/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
index 029ea4f7c5b0c79172bc76d4c092e760a3fb278a..75c8edc08425e7392a92ef8b80cbc1d5b7962bfb 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc
@@ -11,10 +11,17 @@ namespace content {
GpuMemoryBufferImplIOSurface::GpuMemoryBufferImplIOSurface(
const gfx::Size& size,
- unsigned internalformat)
- : GpuMemoryBufferImpl(size, internalformat) {}
+ const DestructionCallback& callback)
+ : GpuMemoryBufferImpl(size, internalformat), callback_(callback) {
+}
+
+GpuMemoryBufferImplIOSurface::~GpuMemoryBufferImplIOSurface() {
+ if (!io_surface_)
+ return;
-GpuMemoryBufferImplIOSurface::~GpuMemoryBufferImplIOSurface() {}
+ // Call destruction callback if instance was successfully initialized.
+ callback_.Run();
piman 2014/09/24 03:19:10 I think it would be nice if the callback_ was mana
reveman 2014/09/24 06:03:38 Yes, that's much better. Thanks for the suggestion
+}
// static
bool GpuMemoryBufferImplIOSurface::IsFormatSupported(unsigned internalformat) {

Powered by Google App Engine
This is Rietveld 408576698