Bug 1604549 - remove scriptability and classinfo from nsThreadPool; r=bzbarsky

There's no reason for this class to be exposed to script; it'd be
awkward to use from script anyway, because the runnables script
dispatches would be running off the main thread.  Thread pool listeners
likewise can't be exposed to script or implemented by script, because
they are also running off the main thread.  The classinfo stuff just
seems like a relic from a bygone era.

Differential Revision: https://phabricator.services.mozilla.com/D57485

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nathan Froyd 2019-12-17 17:12:14 +00:00
Родитель 2cc18dcb1f
Коммит ee4548c7d5
2 изменённых файлов: 4 добавлений и 8 удалений

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

@ -6,7 +6,7 @@
#include "nsIEventTarget.idl"
[scriptable, uuid(ef194cab-3f86-4b61-b132-e5e96a79e5d1)]
[uuid(ef194cab-3f86-4b61-b132-e5e96a79e5d1)]
interface nsIThreadPoolListener : nsISupports
{
/**
@ -27,7 +27,7 @@ interface nsIThreadPoolListener : nsISupports
* anonymous (unnamed) worker threads. An event dispatched to the thread pool
* will be run on the next available worker thread.
*/
[builtinclass, scriptable, uuid(76ce99c9-8e43-489a-9789-f27cc4424965)]
[uuid(76ce99c9-8e43-489a-9789-f27cc4424965)]
interface nsIThreadPool : nsIEventTarget
{
/**

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

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsCOMArray.h"
#include "nsIClassInfoImpl.h"
#include "ThreadDelay.h"
#include "nsThreadPool.h"
#include "nsThreadManager.h"
@ -41,11 +40,8 @@ static MOZ_THREAD_LOCAL(nsThreadPool*) gCurrentThreadPool;
NS_IMPL_ADDREF(nsThreadPool)
NS_IMPL_RELEASE(nsThreadPool)
NS_IMPL_CLASSINFO(nsThreadPool, nullptr, nsIClassInfo::THREADSAFE,
NS_THREADPOOL_CID)
NS_IMPL_QUERY_INTERFACE_CI(nsThreadPool, nsIThreadPool, nsIEventTarget,
nsIRunnable)
NS_IMPL_CI_INTERFACE_GETTER(nsThreadPool, nsIThreadPool, nsIEventTarget)
NS_IMPL_QUERY_INTERFACE(nsThreadPool, nsIThreadPool, nsIEventTarget,
nsIRunnable)
nsThreadPool::nsThreadPool()
: mMutex("[nsThreadPool.mMutex]"),