Bug 1323100 - Remove NS_SetThreadName which is now unused. r?froydnj
MozReview-Commit-ID: 7je5PhV1TsU
--- a/xpcom/glue/nsThreadUtils.cpp
+++ b/xpcom/glue/nsThreadUtils.cpp
@@ -385,66 +385,16 @@ NS_ProcessNextEvent(nsIThread* aThread,
}
aThread = current.get();
}
#endif
bool val;
return NS_SUCCEEDED(aThread->ProcessNextEvent(aMayWait, &val)) && val;
}
-#ifndef XPCOM_GLUE_AVOID_NSPR
-
-namespace {
-
-class nsNameThreadRunnable final : public nsIRunnable
-{
- ~nsNameThreadRunnable() {}
-
-public:
- explicit nsNameThreadRunnable(const nsACString& aName) : mName(aName) {}
-
- NS_DECL_THREADSAFE_ISUPPORTS
- NS_DECL_NSIRUNNABLE
-
-protected:
- const nsCString mName;
-};
-
-NS_IMPL_ISUPPORTS(nsNameThreadRunnable, nsIRunnable)
-
-NS_IMETHODIMP
-nsNameThreadRunnable::Run()
-{
- PR_SetCurrentThreadName(mName.BeginReading());
- return NS_OK;
-}
-
-} // namespace
-
-void
-NS_SetThreadName(nsIThread* aThread, const nsACString& aName)
-{
- if (!aThread) {
- return;
- }
-
- aThread->Dispatch(new nsNameThreadRunnable(aName),
- nsIEventTarget::DISPATCH_NORMAL);
-}
-
-#else // !XPCOM_GLUE_AVOID_NSPR
-
-void
-NS_SetThreadName(nsIThread* aThread, const nsACString& aName)
-{
- // No NSPR, no love.
-}
-
-#endif
-
#ifdef MOZILLA_INTERNAL_API
nsIThread*
NS_GetCurrentThread()
{
return nsThreadManager::get().GetCurrentThread();
}
#endif
--- a/xpcom/glue/nsThreadUtils.h
+++ b/xpcom/glue/nsThreadUtils.h
@@ -28,34 +28,16 @@
#include "mozilla/Tuple.h"
#include "mozilla/TypeTraits.h"
//-----------------------------------------------------------------------------
// These methods are alternatives to the methods on nsIThreadManager, provided
// for convenience.
/**
- * Set name of the target thread. This operation is asynchronous.
- */
-extern void NS_SetThreadName(nsIThread* aThread, const nsACString& aName);
-
-/**
- * Static length version of the above function checking length of the
- * name at compile time.
- */
-template<size_t LEN>
-inline void
-NS_SetThreadName(nsIThread* aThread, const char (&aName)[LEN])
-{
- static_assert(LEN <= 16,
- "Thread name must be no more than 16 characters");
- NS_SetThreadName(aThread, nsDependentCString(aName));
-}
-
-/**
* Create a new thread, and optionally provide an initial event for the thread.
*
* @param aResult
* The resulting nsIThread object.
* @param aInitialEvent
* The initial event to run on this thread. This parameter may be null.
* @param aStackSize
* The size in bytes to reserve for the thread's stack.