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
Родитель dc2c1e74ca
Коммит c2230eeb1d
2 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

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

Просмотреть файл

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