diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 22:36:38 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 22:36:38 +0000 |
commit | adabb62712f972e63fb19afc727093b2008d82ad (patch) | |
tree | b384d924ec7531cc9efb7432d290a8b0ab593845 /media/tools/player_x11/gl_video_renderer.cc | |
parent | 4a338b43f6ecc9e030c9cd177e90f3308ea7fdd4 (diff) | |
download | chromium_src-adabb62712f972e63fb19afc727093b2008d82ad.zip chromium_src-adabb62712f972e63fb19afc727093b2008d82ad.tar.gz chromium_src-adabb62712f972e63fb19afc727093b2008d82ad.tar.bz2 |
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<CallbackN<>> 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
Diffstat (limited to 'media/tools/player_x11/gl_video_renderer.cc')
-rw-r--r-- | media/tools/player_x11/gl_video_renderer.cc | 11 |
1 files changed, 5 insertions, 6 deletions
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 <X11/Xutil.h> +#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() { |