Bug 1162720 - Rename CallbackRunnable::New to NewRunnableFrom. r=jesup

This commit is contained in:
Jan-Ivar Bruaroey 2015-05-14 07:30:00 -04:00
parent 5073bd4761
commit 625c6452b6
2 changed files with 6 additions and 9 deletions

View File

@ -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();

View File

@ -167,13 +167,11 @@ protected:
// General purpose runnable with an eye toward lambdas
namespace CallbackRunnable
{
template<typename OnRunType>
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<typename OnRunType>
Impl<OnRunType>*
New(OnRunType aOnRun)
LambdaRunnable<OnRunType>*
NewRunnableFrom(OnRunType aOnRun)
{
return new Impl<OnRunType>(aOnRun);
}
return new LambdaRunnable<OnRunType>(aOnRun);
}
}