Skip to content

Commit f78d18d

Browse files
Backed out 8 changesets (bug 1695580) for causing build bustages on DataMutex.h. CLOSED TREE
Backed out changeset ec0b0fcc8d88 (bug 1695580) Backed out changeset 982a46056fcb (bug 1695580) Backed out changeset e38e8b90f119 (bug 1695580) Backed out changeset 6fdd154aa151 (bug 1695580) Backed out changeset d04f7a7ec375 (bug 1695580) Backed out changeset 2103cd9e58b7 (bug 1695580) Backed out changeset de9a7dd7fc79 (bug 1695580) Backed out changeset ae16f09be41b (bug 1695580)
1 parent 621339b commit f78d18d

25 files changed

+102
-576
lines changed

dom/media/mediacontrol/MediaController.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "mozilla/dom/MediaSession.h"
1616
#include "mozilla/LinkedList.h"
1717
#include "nsISupportsImpl.h"
18-
#include "nsITimer.h"
1918

2019
namespace mozilla {
2120
namespace dom {

modules/libpref/init/all.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ pref("toolkit.telemetry.unified", true);
803803
#if defined(MOZ_TSAN)
804804
pref("toolkit.asyncshutdown.crash_timeout", 360000); // 6 minutes
805805
#else
806-
pref("toolkit.asyncshutdown.crash_timeout", 300000); // 5 minutes
806+
pref("toolkit.asyncshutdown.crash_timeout", 180000); // 3 minutes
807807
#endif
808808
#endif // !defined(MOZ_ASAN) && !defined(MOZ_TSAN)
809809
// Extra logging for AsyncShutdown barriers and phases

netwerk/base/nsStreamTransportService.cpp

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "nsITransport.h"
1717
#include "nsIObserverService.h"
1818
#include "nsThreadPool.h"
19-
#include "mozilla/DelayedRunnable.h"
2019
#include "mozilla/Services.h"
2120

2221
namespace mozilla {
@@ -244,12 +243,6 @@ nsInputStreamTransport::OnInputStreamReady(nsIAsyncInputStream* aStream) {
244243
// nsStreamTransportService
245244
//-----------------------------------------------------------------------------
246245

247-
nsStreamTransportService::nsStreamTransportService()
248-
: mScheduledDelayedRunnables(
249-
"nsStreamTransportService.mScheduledDelayedRunnables"),
250-
mShutdownLock("nsStreamTransportService.mShutdownLock"),
251-
mIsShutdown(false) {}
252-
253246
nsStreamTransportService::~nsStreamTransportService() {
254247
NS_ASSERTION(!mPool, "thread pool wasn't shutdown");
255248
}
@@ -269,25 +262,8 @@ nsresult nsStreamTransportService::Init() {
269262
return NS_OK;
270263
}
271264

272-
void nsStreamTransportService::OnDelayedRunnableCreated(
273-
DelayedRunnable* aRunnable) {}
274-
275-
void nsStreamTransportService::OnDelayedRunnableScheduled(
276-
DelayedRunnable* aRunnable) {
277-
MOZ_ASSERT(IsOnCurrentThread());
278-
auto delayedRunnables = mScheduledDelayedRunnables.Lock();
279-
delayedRunnables->AppendElement(aRunnable);
280-
}
281-
282-
void nsStreamTransportService::OnDelayedRunnableRan(
283-
DelayedRunnable* aRunnable) {
284-
MOZ_ASSERT(IsOnCurrentThread());
285-
auto delayedRunnables = mScheduledDelayedRunnables.Lock();
286-
MOZ_ALWAYS_TRUE(delayedRunnables->RemoveElement(aRunnable));
287-
}
288-
289265
NS_IMPL_ISUPPORTS(nsStreamTransportService, nsIStreamTransportService,
290-
nsIEventTarget, nsIDelayedRunnableObserver, nsIObserver)
266+
nsIEventTarget, nsIObserver)
291267

292268
NS_IMETHODIMP
293269
nsStreamTransportService::DispatchFromScript(nsIRunnable* task,
@@ -377,31 +353,6 @@ nsStreamTransportService::Observe(nsISupports* subject, const char* topic,
377353
mPool->Shutdown();
378354
mPool = nullptr;
379355
}
380-
381-
// Because the DelayedRunnables are run by a thread pool, no guarantee is
382-
// given to which thread they run or get released on. Releasing them on the
383-
// thread pool or on the background target thus doesn't really matter. We are
384-
// forced to do it on the background target after the thread pool has finished
385-
// processing all events, since doing it on the thread pool would allow the
386-
// shutdown task to race with scheduling new DelayedRunnables, possibly
387-
// missing the cleanup of some of them.
388-
nsTArray<RefPtr<DelayedRunnable>> delayedRunnables;
389-
{
390-
auto sdrs = mScheduledDelayedRunnables.Lock();
391-
std::swap(*sdrs, delayedRunnables);
392-
MOZ_ASSERT(sdrs->IsEmpty());
393-
}
394-
if (!delayedRunnables.IsEmpty()) {
395-
NS_DispatchBackgroundTask(
396-
NS_NewRunnableFunction(
397-
"nsStreamTransportService::mScheduledDelayedRunnables Cancel",
398-
[delayedRunnables = std::move(delayedRunnables)] {
399-
for (const auto& r : delayedRunnables) {
400-
r->CancelTimer();
401-
}
402-
}),
403-
NS_DISPATCH_SYNC);
404-
}
405356
return NS_OK;
406357
}
407358

netwerk/base/nsStreamTransportService.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,21 @@
55
#ifndef nsStreamTransportService_h__
66
#define nsStreamTransportService_h__
77

8-
#include "nsIDelayedRunnableObserver.h"
98
#include "nsIStreamTransportService.h"
109
#include "nsIEventTarget.h"
1110
#include "nsIObserver.h"
1211
#include "nsCOMPtr.h"
1312
#include "nsThreadUtils.h"
1413
#include "mozilla/Attributes.h"
15-
#include "mozilla/DataMutex.h"
1614
#include "mozilla/Mutex.h"
1715

1816
class nsIThreadPool;
1917

2018
namespace mozilla {
21-
class DelayedRunnable;
22-
2319
namespace net {
2420

2521
class nsStreamTransportService final : public nsIStreamTransportService,
2622
public nsIEventTarget,
27-
public nsIDelayedRunnableObserver,
2823
public nsIObserver {
2924
public:
3025
NS_DECL_THREADSAFE_ISUPPORTS
@@ -34,19 +29,15 @@ class nsStreamTransportService final : public nsIStreamTransportService,
3429

3530
nsresult Init();
3631

37-
nsStreamTransportService();
38-
39-
void OnDelayedRunnableCreated(DelayedRunnable* aRunnable) override;
40-
void OnDelayedRunnableScheduled(DelayedRunnable* aRunnable) override;
41-
void OnDelayedRunnableRan(DelayedRunnable* aRunnable) override;
32+
nsStreamTransportService()
33+
: mShutdownLock("nsStreamTransportService.mShutdownLock"),
34+
mIsShutdown(false) {}
4235

4336
private:
4437
~nsStreamTransportService();
4538

4639
nsCOMPtr<nsIThreadPool> mPool;
4740

48-
DataMutex<nsTArray<RefPtr<DelayedRunnable>>> mScheduledDelayedRunnables;
49-
5041
mozilla::Mutex mShutdownLock;
5142
bool mIsShutdown;
5243
};

netwerk/protocol/websocket/WebSocketChannel.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,8 +1181,6 @@ WebSocketChannel::~WebSocketChannel() {
11811181

11821182
NS_ReleaseOnMainThread("WebSocketChannel::mLoadGroup", mLoadGroup.forget());
11831183
NS_ReleaseOnMainThread("WebSocketChannel::mLoadInfo", mLoadInfo.forget());
1184-
NS_ReleaseOnMainThread("WebSocketChannel::mTargetThread",
1185-
mTargetThread.forget());
11861184
NS_ReleaseOnMainThread("WebSocketChannel::mService", mService.forget());
11871185
}
11881186

testing/mochitest/mochitest_options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,7 @@ def validate(self, parser, options, context):
11741174
"forkserver": options.defaultLeakThreshold,
11751175
# GMP rarely gets a log, but when it does, it leaks a little.
11761176
"gmplugin": 20000,
1177+
"rdd": 400,
11771178
}
11781179

11791180
# See the dependencies of bug 1401764.

xpcom/build/XPCOMInit.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,6 @@ nsresult ShutdownXPCOM(nsIServiceManager* aServMgr) {
621621

622622
mozilla::AppShutdown::AdvanceShutdownPhase(
623623
mozilla::ShutdownPhase::XPCOMShutdownThreads);
624-
nsThreadManager::get().CancelBackgroundDelayedRunnables();
625624
gXPCOMThreadsShutDown = true;
626625
NS_ProcessPendingEvents(thread);
627626

xpcom/tests/gtest/TestDelayedRunnable.cpp

Lines changed: 0 additions & 104 deletions
This file was deleted.

xpcom/tests/gtest/moz.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ UNIFIED_SOURCES += [
1616
"TestCOMPtrEq.cpp",
1717
"TestCRT.cpp",
1818
"TestDafsa.cpp",
19-
"TestDelayedRunnable.cpp",
2019
"TestEncoding.cpp",
2120
"TestEscape.cpp",
2221
"TestEventPriorities.cpp",

xpcom/threads/AbstractThread.cpp

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "mozilla/AbstractThread.h"
88

99
#include "mozilla/ClearOnShutdown.h"
10-
#include "mozilla/DelayedRunnable.h"
1110
#include "mozilla/Maybe.h"
1211
#include "mozilla/MozPromise.h" // We initialize the MozPromise logging in this file.
1312
#include "mozilla/StateWatching.h" // We initialize the StateWatching logging in this file.
@@ -31,14 +30,12 @@ MOZ_THREAD_LOCAL(AbstractThread*) AbstractThread::sCurrentThreadTLS;
3130

3231
class XPCOMThreadWrapper final : public AbstractThread,
3332
public nsIThreadObserver,
34-
public nsIDirectTaskDispatcher,
35-
public nsIDelayedRunnableObserver {
33+
public nsIDirectTaskDispatcher {
3634
public:
3735
XPCOMThreadWrapper(nsIThreadInternal* aThread, bool aRequireTailDispatch,
3836
bool aOnThread)
3937
: AbstractThread(aRequireTailDispatch),
4038
mThread(aThread),
41-
mDelayedRunnableObserver(do_QueryInterface(mThread)),
4239
mDirectTaskDispatcher(do_QueryInterface(aThread)),
4340
mOnThread(aOnThread) {
4441
MOZ_DIAGNOSTIC_ASSERT(mThread && mDirectTaskDispatcher);
@@ -160,22 +157,8 @@ class XPCOMThreadWrapper final : public AbstractThread,
160157
return mDirectTaskDispatcher->HaveDirectTasks(aResult);
161158
}
162159

163-
//-----------------------------------------------------------------------------
164-
// nsIDelayedRunnableObserver
165-
//-----------------------------------------------------------------------------
166-
void OnDelayedRunnableCreated(DelayedRunnable* aRunnable) override {
167-
mDelayedRunnableObserver->OnDelayedRunnableCreated(aRunnable);
168-
}
169-
void OnDelayedRunnableScheduled(DelayedRunnable* aRunnable) override {
170-
mDelayedRunnableObserver->OnDelayedRunnableScheduled(aRunnable);
171-
}
172-
void OnDelayedRunnableRan(DelayedRunnable* aRunnable) override {
173-
mDelayedRunnableObserver->OnDelayedRunnableRan(aRunnable);
174-
}
175-
176160
private:
177161
const RefPtr<nsIThreadInternal> mThread;
178-
const nsCOMPtr<nsIDelayedRunnableObserver> mDelayedRunnableObserver;
179162
const nsCOMPtr<nsIDirectTaskDispatcher> mDirectTaskDispatcher;
180163
Maybe<AutoTaskDispatcher> mTailDispatcher;
181164
const bool mOnThread;
@@ -231,16 +214,8 @@ class XPCOMThreadWrapper final : public AbstractThread,
231214
const RefPtr<nsIRunnable> mRunnable;
232215
};
233216
};
234-
235-
NS_INTERFACE_MAP_BEGIN(XPCOMThreadWrapper)
236-
NS_INTERFACE_MAP_ENTRY(nsIThreadObserver)
237-
NS_INTERFACE_MAP_ENTRY(nsIDirectTaskDispatcher)
238-
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIDelayedRunnableObserver,
239-
mDelayedRunnableObserver)
240-
NS_INTERFACE_MAP_END_INHERITING(AbstractThread)
241-
242-
NS_IMPL_ADDREF_INHERITED(XPCOMThreadWrapper, AbstractThread)
243-
NS_IMPL_RELEASE_INHERITED(XPCOMThreadWrapper, AbstractThread)
217+
NS_IMPL_ISUPPORTS_INHERITED(XPCOMThreadWrapper, AbstractThread,
218+
nsIThreadObserver, nsIDirectTaskDispatcher);
244219

245220
NS_IMPL_ISUPPORTS(AbstractThread, nsIEventTarget, nsISerialEventTarget)
246221

0 commit comments

Comments
 (0)