From adabb62712f972e63fb19afc727093b2008d82ad Mon Sep 17 00:00:00 2001 From: "fischman@chromium.org" Date: Thu, 29 Sep 2011 22:36:38 +0000 Subject: Convert all of media/ over to the new base::{Bind,Callback} hotness. Mostly this was a rote conversion, replacing: - Pass-by-pointer CallbackN<>'s become pass-by-const-ref Callback<>'s. - scoped_ptr> members become Callback<> members. - several dedicated FooCallback typedefs became base::Closure. Because it was only used in a small handful of places and only in one place profitably, I deleted AutoCallbackRunner. Because it tickles a Bind bug I disabled mfdecoder in .gyp (about to get deleted in a scherkus CL). BUG=none TEST=media_tests, trybots Review URL: http://codereview.chromium.org/8071007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103376 0039d316-1c4b-4281-b951-d872f2087c98 --- media/tools/player_x11/gl_video_renderer.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'media/tools/player_x11/gl_video_renderer.cc') diff --git a/media/tools/player_x11/gl_video_renderer.cc b/media/tools/player_x11/gl_video_renderer.cc index 6c6cda4..3ce1f5f 100644 --- a/media/tools/player_x11/gl_video_renderer.cc +++ b/media/tools/player_x11/gl_video_renderer.cc @@ -6,6 +6,7 @@ #include +#include "base/bind.h" #include "base/message_loop.h" #include "media/base/buffers.h" #include "media/base/video_frame.h" @@ -22,13 +23,11 @@ GlVideoRenderer::GlVideoRenderer(Display* display, Window window, GlVideoRenderer::~GlVideoRenderer() {} -void GlVideoRenderer::OnStop(media::FilterCallback* callback) { +void GlVideoRenderer::OnStop(const base::Closure& callback) { glXMakeCurrent(display_, 0, NULL); glXDestroyContext(display_, gl_context_); - if (callback) { - callback->Run(); - delete callback; - } + if (!callback.is_null()) + callback.Run(); } static GLXContext InitGLContext(Display* display, Window window) { @@ -231,7 +230,7 @@ bool GlVideoRenderer::OnInitialize(media::VideoDecoder* decoder) { void GlVideoRenderer::OnFrameAvailable() { main_message_loop_->PostTask(FROM_HERE, - NewRunnableMethod(this, &GlVideoRenderer::PaintOnMainThread)); + base::Bind(&GlVideoRenderer::PaintOnMainThread, this)); } void GlVideoRenderer::PaintOnMainThread() { -- cgit v1.1