From 9b38306626834368742ae1fd4a5f57348a871d98 Mon Sep 17 00:00:00 2001 From: Seth Fowler Date: Sat, 25 Jun 2016 22:11:41 -0700 Subject: [PATCH] Bug 1282273 - Replace the Runnable used for registering DecodePool threads with the Nuwa process with a lambda. r=edwin --- image/DecodePool.cpp | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/image/DecodePool.cpp b/image/DecodePool.cpp index dac4715d3096..c2bce0e0d35c 100644 --- a/image/DecodePool.cpp +++ b/image/DecodePool.cpp @@ -33,25 +33,6 @@ using std::min; namespace mozilla { namespace image { -/////////////////////////////////////////////////////////////////////////////// -// Helper runnables. -/////////////////////////////////////////////////////////////////////////////// - -#ifdef MOZ_NUWA_PROCESS - -class RegisterDecodeIOThreadWithNuwaRunnable : public Runnable -{ -public: - NS_IMETHOD Run() - { - NuwaMarkCurrentThread(static_cast(nullptr), nullptr); - return NS_OK; - } -}; - -#endif // MOZ_NUWA_PROCESS - - /////////////////////////////////////////////////////////////////////////////// // DecodePool implementation. /////////////////////////////////////////////////////////////////////////////// @@ -291,8 +272,10 @@ DecodePool::DecodePool() "Should successfully create image I/O thread"); #ifdef MOZ_NUWA_PROCESS - nsCOMPtr worker = new RegisterDecodeIOThreadWithNuwaRunnable(); - rv = mIOThread->Dispatch(worker, NS_DISPATCH_NORMAL); + rv = mIOThread->Dispatch(NS_NewRunnableFunction([]() -> void { + NuwaMarkCurrentThread(static_cast(nullptr), nullptr); + }), NS_DISPATCH_NORMAL); + MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv), "Should register decode IO thread with Nuwa process"); #endif