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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 19990007: Don't leak CopyResult textures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « cc/output/copy_output_result.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 8fbaad82ee016e1739ea068b586ac9b7a0ab1629..463492a2c9dcbfcf784a89be5a54fe8d338a5185 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1719,10 +1719,12 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurfaceHasResult(
static void CopyFromCompositingSurfaceFinished(
const base::Callback<void(bool, const SkBitmap&)>& callback,
+ const cc::TextureMailbox::ReleaseCallback& release_callback,
scoped_ptr<SkBitmap> bitmap,
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock,
bool result) {
bitmap_pixels_lock.reset();
+ release_callback.Run(0, false);
callback.Run(result, *bitmap);
}
@@ -1770,6 +1772,7 @@ void RenderWidgetHostViewAura::PrepareTextureCopyOutputResult(
pixels,
base::Bind(&CopyFromCompositingSurfaceFinished,
callback,
+ texture_mailbox->callback(),
base::Passed(&bitmap),
base::Passed(&bitmap_pixels_lock)));
}
@@ -1801,6 +1804,14 @@ void RenderWidgetHostViewAura::PrepareBitmapCopyOutputResult(
callback.Run(true, bitmap);
}
+static void CopyFromCompositingSurfaceFinishedForVideo(
+ const base::Callback<void(bool)>& callback,
+ const cc::TextureMailbox::ReleaseCallback& release_callback,
+ bool result) {
+ release_callback.Run(0, false);
+ callback.Run(result);
+}
+
// static
void RenderWidgetHostViewAura::CopyFromCompositingSurfaceHasResultForVideo(
base::WeakPtr<RenderWidgetHostViewAura> rwhva,
@@ -1884,11 +1895,15 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurfaceHasResultForVideo(
}
scoped_callback_runner.Release();
+ base::Callback<void(bool result)> finished_callback = base::Bind(
+ &CopyFromCompositingSurfaceFinishedForVideo,
+ callback,
+ texture_mailbox->callback());
yuv_readback_pipeline->ReadbackYUV(
texture_mailbox->name(),
texture_mailbox->sync_point(),
video_frame.get(),
- callback);
+ finished_callback);
}
void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) {
« no previous file with comments | « cc/output/copy_output_result.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698