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

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.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_surface_texture.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc b/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc
index afb4bf2656abe91dd928aeaffeafb5bfffe3055c..8ee1e25562f1137c45df6e51b3c45b9030360d68 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc
@@ -13,14 +13,18 @@ namespace content {
GpuMemoryBufferImplSurfaceTexture::GpuMemoryBufferImplSurfaceTexture(
const gfx::Size& size,
- unsigned internalformat)
- : GpuMemoryBufferImpl(size, internalformat),
+ unsigned internalformat,
+ const DestructionCallback& callback)
+ : GpuMemoryBufferImpl(size, internalformat), callback_(callback) {
native_window_(NULL),
stride_(0u) {}
GpuMemoryBufferImplSurfaceTexture::~GpuMemoryBufferImplSurfaceTexture() {
- if (native_window_)
- ANativeWindow_release(native_window_);
+ if (!native_window_)
+ return;
+
+ ANativeWindow_release(native_window_);
+ callback_.Run();
}
// static

Powered by Google App Engine
This is Rietveld 408576698