зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1694462 - Remove the nsIThreadManager.newThread API (newNamedThread should be used instead), r=bas,KrisWright.
Differential Revision: https://phabricator.services.mozilla.com/D106267
This commit is contained in:
Родитель
ba88a740fc
Коммит
b41e171c11
|
@ -63,6 +63,7 @@ RemoteLzyStream
|
|||
RWLockTester
|
||||
RacingServMan
|
||||
RemVidChild
|
||||
ResetCleanup
|
||||
Sandbox Testing
|
||||
SaveScripts
|
||||
Socket Thread
|
||||
|
@ -72,6 +73,7 @@ StressRunner
|
|||
SuicideManager
|
||||
SuicideThread
|
||||
TEQ AwaitIdle
|
||||
TelemetryModule
|
||||
Test Thread
|
||||
Test thread
|
||||
TestPipe
|
||||
|
|
|
@ -73,7 +73,6 @@
|
|||
#include "nsReadableUtils.h"
|
||||
#include "nsString.h"
|
||||
#include "nsTHashtable.h"
|
||||
#include "nsThreadManager.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#if defined(XP_WIN)
|
||||
# include "nsUnicharUtils.h"
|
||||
|
@ -873,9 +872,9 @@ TelemetryImpl::GetLoadedModules(JSContext* cx, Promise** aPromise) {
|
|||
return result.StealNSResult();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIThreadManager> tm = do_GetService(NS_THREADMANAGER_CONTRACTID);
|
||||
nsCOMPtr<nsIThread> getModulesThread;
|
||||
nsresult rv = tm->NewThread(0, 0, getter_AddRefs(getModulesThread));
|
||||
nsresult rv =
|
||||
NS_NewNamedThread("TelemetryModule", getter_AddRefs(getModulesThread));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
promise->MaybeReject(NS_ERROR_FAILURE);
|
||||
return NS_OK;
|
||||
|
|
|
@ -124,9 +124,8 @@ nsresult ProfileResetCleanup(nsToolkitProfileService* aService,
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Create a new thread to do the bulk of profile cleanup to stay responsive.
|
||||
nsCOMPtr<nsIThreadManager> tm = do_GetService(NS_THREADMANAGER_CONTRACTID);
|
||||
nsCOMPtr<nsIThread> cleanupThread;
|
||||
rv = tm->NewThread(0, 0, getter_AddRefs(cleanupThread));
|
||||
rv = NS_NewNamedThread("ResetCleanup", getter_AddRefs(cleanupThread));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIRunnable> runnable = new ProfileResetCleanupAsyncTask(
|
||||
profileDir, profileLocalDir, containerDest, leafName);
|
||||
|
|
|
@ -55,26 +55,11 @@ interface nsIThreadManager : nsISupports
|
|||
static const uint32_t kThreadPoolStackSize = DEFAULT_STACK_SIZE;
|
||||
%}
|
||||
|
||||
/**
|
||||
* Create a new thread (a global, user PRThread).
|
||||
*
|
||||
* @param creationFlags
|
||||
* Reserved for future use. Pass 0.
|
||||
* @param stackSize
|
||||
* Number of bytes to reserve for the thread's stack. 0 means use platform
|
||||
* default.
|
||||
*
|
||||
* @returns
|
||||
* The newly created nsIThread object.
|
||||
*/
|
||||
nsIThread newThread(in unsigned long creationFlags, [optional] in unsigned long stackSize);
|
||||
|
||||
/**
|
||||
* Create a new thread (a global, user PRThread) with the specified name.
|
||||
*
|
||||
* @param name
|
||||
* The name of the thread. Passing an empty name is equivalent to
|
||||
* calling newThread(0, stackSize), i.e. the thread will not be named.
|
||||
* The name of the thread. If it is empty the thread will not be named.
|
||||
* @param stackSize
|
||||
* Number of bytes to reserve for the thread's stack. 0 means use platform
|
||||
* default.
|
||||
|
|
|
@ -616,12 +616,6 @@ bool nsThreadManager::IsNSThread() const {
|
|||
return false;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsThreadManager::NewThread(uint32_t aCreationFlags, uint32_t aStackSize,
|
||||
nsIThread** aResult) {
|
||||
return NewNamedThread(""_ns, aStackSize, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsThreadManager::NewNamedThread(const nsACString& aName, uint32_t aStackSize,
|
||||
nsIThread** aResult) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче