From c2230eeb1d4d80b07ab61d7ec707f1f7f1080131 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Thu, 14 May 2015 07:30:00 -0400 Subject: [PATCH] Bug 1162720 - Rename CallbackRunnable::New to NewRunnableFrom. r=jesup --- dom/media/MediaManager.cpp | 2 +- dom/media/systemservices/MediaUtils.h | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index e849a7c6cc5c..91e295c6e1a5 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -2242,7 +2242,7 @@ MediaManager::Observe(nsISupports* aSubject, const char* aTopic, // cleared until the lambda function clears it. MediaManager::GetMessageLoop()->PostTask(FROM_HERE, new ShutdownTask( - media::CallbackRunnable::New([this]() mutable { + media::NewRunnableFrom([this]() mutable { // Close off any remaining active windows. MutexAutoLock lock(mMutex); GetActiveWindows()->Clear(); diff --git a/dom/media/systemservices/MediaUtils.h b/dom/media/systemservices/MediaUtils.h index a6a5a833438b..85546f8c8d93 100644 --- a/dom/media/systemservices/MediaUtils.h +++ b/dom/media/systemservices/MediaUtils.h @@ -167,13 +167,11 @@ protected: // General purpose runnable with an eye toward lambdas -namespace CallbackRunnable -{ template -class Impl : public nsRunnable +class LambdaRunnable : public nsRunnable { public: - explicit Impl(OnRunType& aOnRun) : mOnRun(aOnRun) {} + explicit LambdaRunnable(OnRunType& aOnRun) : mOnRun(aOnRun) {} private: NS_IMETHODIMP Run() @@ -184,11 +182,10 @@ private: }; template -Impl* -New(OnRunType aOnRun) +LambdaRunnable* +NewRunnableFrom(OnRunType aOnRun) { - return new Impl(aOnRun); -} + return new LambdaRunnable(aOnRun); } }