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

Unified Diff: media/filters/video_renderer_base.cc

Issue 9717021: Make Callback::Reset() return a copy to support use-cases where Run() ends up modifying |*this|. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no base:: Created 8 years, 9 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 | « media/filters/gpu_video_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_base.cc
diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc
index 47db2ecf120573d41d69a34b30ef41bf65ef394d..08a8271621beaa31e14d0954b0d797eb82ea0654 100644
--- a/media/filters/video_renderer_base.cc
+++ b/media/filters/video_renderer_base.cc
@@ -4,6 +4,7 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/threading/platform_thread.h"
#include "media/base/buffers.h"
#include "media/base/filter_host.h"
@@ -372,7 +373,7 @@ void VideoRendererBase::FrameReady(scoped_refptr<VideoFrame> frame) {
// A new seek will be requested after this one completes so there is no
// point trying to collect more frames.
state_ = kPrerolled;
- ResetAndRunCB(&seek_cb_, PIPELINE_OK);
+ base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK);
return;
}
@@ -431,7 +432,7 @@ void VideoRendererBase::FrameReady(scoped_refptr<VideoFrame> frame) {
// ...and we're done seeking!
DCHECK(!seek_cb_.is_null());
- ResetAndRunCB(&seek_cb_, PIPELINE_OK);
+ base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK);
base::AutoUnlock ul(lock_);
paint_cb_.Run();
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698