Backed out changeset 541b98270c99 (bug 1539944) for causing bc leaks CLOSED TREE

This commit is contained in:
Ciure Andrei 2020-02-12 03:23:15 +02:00
Родитель 410dc434d0
Коммит 0ddf5384e0
6 изменённых файлов: 17 добавлений и 13 удалений

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

@ -78,8 +78,7 @@ static int RunDecodeToSurfaceFuzzing(nsCOMPtr<nsIInputStream> inputStream,
}
nsCOMPtr<nsIThread> thread;
nsresult rv =
NS_NewNamedThread("Decoder Test", getter_AddRefs(thread), nullptr);
nsresult rv = NS_NewThread(getter_AddRefs(thread), nullptr);
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
// We run the DecodeToSurface tests off-main-thread to ensure that

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

@ -83,8 +83,7 @@ already_AddRefed<nsIThread> CreateTestThread(const char* aName,
aMonitor.NotifyAll();
});
nsCOMPtr<nsIThread> thread;
mozilla::Unused << NS_NewNamedThread("Test Thread", getter_AddRefs(thread),
setNameRunnable);
mozilla::Unused << NS_NewThread(getter_AddRefs(thread), setNameRunnable);
return thread.forget();
}
@ -137,8 +136,7 @@ TEST(TestCrashThreadAnnotation, TestGetFlatThreadAnnotation_SetNameTwice)
monitor.NotifyAll();
});
nsCOMPtr<nsIThread> thread;
nsresult rv =
NS_NewNamedThread("Test Thread", getter_AddRefs(thread), setNameRunnable);
nsresult rv = NS_NewThread(getter_AddRefs(thread), setNameRunnable);
ASSERT_TRUE(NS_SUCCEEDED(rv));
{

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

@ -165,8 +165,7 @@ TEST(Atoms, ConcurrentAccessing)
EXPECT_EQ(NS_GetUnusedAtomCount(), int32_t(0));
nsCOMPtr<nsIThread> threads[kThreadCount];
for (size_t i = 0; i < kThreadCount; i++) {
nsresult rv = NS_NewNamedThread("Atom Test", getter_AddRefs(threads[i]),
new nsAtomRunner);
nsresult rv = NS_NewThread(getter_AddRefs(threads[i]), new nsAtomRunner);
EXPECT_TRUE(NS_SUCCEEDED(rv));
}
for (size_t i = 0; i < kThreadCount; i++) {

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

@ -52,9 +52,8 @@ TEST(AutoRefCnt, ThreadSafeAutoRefCntBalance)
static const size_t kThreadCount = 4;
nsCOMPtr<nsIThread> threads[kThreadCount];
for (size_t i = 0; i < kThreadCount; i++) {
nsresult rv =
NS_NewNamedThread("AutoRefCnt Test", getter_AddRefs(threads[i]),
new nsThreadSafeAutoRefCntRunner);
nsresult rv = NS_NewThread(getter_AddRefs(threads[i]),
new nsThreadSafeAutoRefCntRunner);
EXPECT_TRUE(NS_SUCCEEDED(rv));
}
for (size_t i = 0; i < kThreadCount; i++) {

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

@ -164,6 +164,11 @@ nsresult NS_NewNamedThread(const nsACString& aName, nsIThread** aResult,
return NS_OK;
}
nsresult NS_NewThread(nsIThread** aResult, nsIRunnable* aEvent,
uint32_t aStackSize) {
return NS_NewNamedThread(NS_LITERAL_CSTRING(""), aResult, aEvent, aStackSize);
}
nsresult NS_GetCurrentThread(nsIThread** aResult) {
#ifdef MOZILLA_INTERNAL_API
return nsThreadManager::get().nsThreadManager::GetCurrentThread(aResult);

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

@ -38,8 +38,6 @@
/**
* Create a new thread, and optionally provide an initial event for the thread.
*
* @param aName
* The name of the thread.
* @param aResult
* The resulting nsIThread object.
* @param aInitialEvent
@ -50,7 +48,13 @@
* @returns NS_ERROR_INVALID_ARG
* Indicates that the given name is not unique.
*/
extern nsresult NS_NewThread(
nsIThread** aResult, nsIRunnable* aInitialEvent = nullptr,
uint32_t aStackSize = nsIThreadManager::DEFAULT_STACK_SIZE);
/**
* Creates a named thread, otherwise the same as NS_NewThread
*/
extern nsresult NS_NewNamedThread(
const nsACString& aName, nsIThread** aResult,
nsIRunnable* aInitialEvent = nullptr,