Skip to content

Commit 3ccd75a

Browse files
committed
Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD
1 parent ad3ef71 commit 3ccd75a

File tree

202 files changed

+1448
-1523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+1448
-1523
lines changed

docshell/base/timeline/ObservedDocShell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ObservedDocShell : public MarkersStorage {
3737
// Off the main thread only.
3838
Mutex mLock;
3939
nsTArray<UniquePtr<AbstractTimelineMarker>> mOffTheMainThreadTimelineMarkers
40-
MOZ_GUARDED_BY(mLock);
40+
GUARDED_BY(mLock);
4141

4242
public:
4343
explicit ObservedDocShell(nsIDocShell* aDocShell);

docshell/base/timeline/TimelineConsumers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ class TimelineConsumers {
101101
private:
102102
static StaticMutex sMutex;
103103

104-
static LinkedList<MarkersStorage>& MarkersStores() MOZ_REQUIRES(sMutex);
104+
static LinkedList<MarkersStorage>& MarkersStores() REQUIRES(sMutex);
105105

106-
static uint32_t sActiveConsumers MOZ_GUARDED_BY(sMutex);
106+
static uint32_t sActiveConsumers GUARDED_BY(sMutex);
107107
static StaticAutoPtr<LinkedList<MarkersStorage>> sMarkersStores
108-
MOZ_GUARDED_BY(sMutex);
108+
GUARDED_BY(sMutex);
109109
};
110110

111111
} // namespace mozilla

dom/base/BodyStream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ void BodyStream::EnqueueChunkWithSizeIntoStream(JSContext* aCx,
428428
// thread-safety doesn't handle emplace well
429429
NS_IMETHODIMP
430430
BodyStream::OnInputStreamReady(nsIAsyncInputStream* aStream)
431-
MOZ_NO_THREAD_SAFETY_ANALYSIS {
431+
NO_THREAD_SAFETY_ANALYSIS {
432432
AssertIsOnOwningThread();
433433
MOZ_DIAGNOSTIC_ASSERT(aStream);
434434
mAsyncWaitWorkerRef = nullptr;

dom/base/BodyStream.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,17 @@ class BodyStream final : public nsIInputStreamCallback,
141141

142142
void ErrorPropagation(JSContext* aCx,
143143
const MutexSingleWriterAutoLock& aProofOfLock,
144-
ReadableStream* aStream, nsresult aRv)
145-
MOZ_REQUIRES(mMutex);
144+
ReadableStream* aStream, nsresult aRv) REQUIRES(mMutex);
146145

147146
// TODO: convert this to MOZ_CAN_RUN_SCRIPT (bug 1750605)
148147
MOZ_CAN_RUN_SCRIPT_BOUNDARY void CloseAndReleaseObjects(
149148
JSContext* aCx, const MutexSingleWriterAutoLock& aProofOfLock,
150-
ReadableStream* aStream) MOZ_REQUIRES(mMutex);
149+
ReadableStream* aStream) REQUIRES(mMutex);
151150

152151
class WorkerShutdown;
153152

154153
void ReleaseObjects(const MutexSingleWriterAutoLock& aProofOfLock)
155-
MOZ_REQUIRES(mMutex);
154+
REQUIRES(mMutex);
156155

157156
void ReleaseObjects();
158157

@@ -187,12 +186,12 @@ class BodyStream final : public nsIInputStreamCallback,
187186
MutexSingleWriter mMutex;
188187

189188
// Protected by mutex.
190-
State mState MOZ_GUARDED_BY(mMutex); // all writes are from the owning thread
189+
State mState GUARDED_BY(mMutex); // all writes are from the owning thread
191190

192191
// mGlobal is set on creation, and isn't modified off the owning thread.
193192
// It isn't set to nullptr until ReleaseObjects() runs.
194193
nsCOMPtr<nsIGlobalObject> mGlobal;
195-
RefPtr<BodyStreamHolder> mStreamHolder MOZ_GUARDED_BY(mMutex);
194+
RefPtr<BodyStreamHolder> mStreamHolder GUARDED_BY(mMutex);
196195
nsCOMPtr<nsIEventTarget> mOwningEventTarget;
197196

198197
// This is the original inputStream received during the CTOR. It will be

dom/canvas/WebGLContext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
272272
~LruPosition() { Reset(); }
273273
};
274274

275-
mutable LruPosition mLruPosition MOZ_GUARDED_BY(sLruMutex);
275+
mutable LruPosition mLruPosition GUARDED_BY(sLruMutex);
276276

277277
void BumpLruLocked(const StaticMutexAutoLock& aProofOfLock);
278278

@@ -740,7 +740,7 @@ class WebGLContext : public VRefCounted, public SupportsWeakPtr {
740740

741741
private:
742742
static StaticMutex sLruMutex;
743-
static std::list<WebGLContext*> sLru MOZ_GUARDED_BY(sLruMutex);
743+
static std::list<WebGLContext*> sLru GUARDED_BY(sLruMutex);
744744

745745
// State tracking slots
746746
bool mDitherEnabled = true;

dom/console/ConsoleReportCollector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class ConsoleReportCollector final : public nsIConsoleReportCollector {
8181
Mutex mMutex;
8282

8383
// protected by mMutex
84-
nsTArray<PendingReport> mPendingReports MOZ_GUARDED_BY(mMutex);
84+
nsTArray<PendingReport> mPendingReports GUARDED_BY(mMutex);
8585

8686
public:
8787
NS_DECL_THREADSAFE_ISUPPORTS

dom/file/ipc/RemoteLazyInputStream.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ class RemoteLazyInputStream final : public nsIAsyncInputStream,
6666

6767
~RemoteLazyInputStream();
6868

69-
void StreamNeeded() MOZ_REQUIRES(mMutex);
69+
void StreamNeeded() REQUIRES(mMutex);
7070

7171
// Upon receiving the stream from our actor, we will not wrap it into an async
7272
// stream until needed. This allows callers to get access to the underlying
7373
// potentially-sync stream using `TakeInternalStream` before reading.
74-
nsresult EnsureAsyncRemoteStream() MOZ_REQUIRES(mMutex);
74+
nsresult EnsureAsyncRemoteStream() REQUIRES(mMutex);
7575

7676
// Note that data has been read from our input stream, and disconnect from our
7777
// remote actor.
@@ -82,7 +82,7 @@ class RemoteLazyInputStream final : public nsIAsyncInputStream,
8282
IPC::MessageReader* aReader);
8383

8484
// Helper method to generate a description of a stream for use in loggging.
85-
nsCString Describe() MOZ_REQUIRES(mMutex);
85+
nsCString Describe() REQUIRES(mMutex);
8686

8787
// Start and length of the slice to apply on this RemoteLazyInputStream when
8888
// fetching the underlying stream with `SendStreamNeeded`.
@@ -112,7 +112,7 @@ class RemoteLazyInputStream final : public nsIAsyncInputStream,
112112
// mInnerStream is released and any method will return
113113
// NS_BASE_STREAM_CLOSED.
114114
eClosed,
115-
} mState MOZ_GUARDED_BY(mMutex) = eClosed;
115+
} mState GUARDED_BY(mMutex) = eClosed;
116116

117117
// The actor which will be used to provide the underlying stream or length
118118
// information when needed, as well as to efficiently allow transferring the
@@ -121,25 +121,22 @@ class RemoteLazyInputStream final : public nsIAsyncInputStream,
121121
// The connection to our actor will be cleared once the stream has been closed
122122
// or has started reading, at which point this stream will be serialized and
123123
// cloned as-if it was the underlying stream.
124-
RefPtr<RemoteLazyInputStreamChild> mActor MOZ_GUARDED_BY(mMutex);
124+
RefPtr<RemoteLazyInputStreamChild> mActor GUARDED_BY(mMutex);
125125

126-
nsCOMPtr<nsIInputStream> mInnerStream MOZ_GUARDED_BY(mMutex);
127-
nsCOMPtr<nsIAsyncInputStream> mAsyncInnerStream MOZ_GUARDED_BY(mMutex);
126+
nsCOMPtr<nsIInputStream> mInnerStream GUARDED_BY(mMutex);
127+
nsCOMPtr<nsIAsyncInputStream> mAsyncInnerStream GUARDED_BY(mMutex);
128128

129129
// These 2 values are set only if mState is ePending or eRunning.
130130
// RefPtr is used instead of nsCOMPtr to avoid invoking QueryInterface when
131131
// assigning in debug builds, as `mInputStreamCallback` may not be threadsafe.
132-
RefPtr<nsIInputStreamCallback> mInputStreamCallback MOZ_GUARDED_BY(mMutex);
133-
nsCOMPtr<nsIEventTarget> mInputStreamCallbackEventTarget
134-
MOZ_GUARDED_BY(mMutex);
135-
uint32_t mInputStreamCallbackFlags MOZ_GUARDED_BY(mMutex) = 0;
136-
uint32_t mInputStreamCallbackRequestedCount MOZ_GUARDED_BY(mMutex) = 0;
132+
RefPtr<nsIInputStreamCallback> mInputStreamCallback GUARDED_BY(mMutex);
133+
nsCOMPtr<nsIEventTarget> mInputStreamCallbackEventTarget GUARDED_BY(mMutex);
134+
uint32_t mInputStreamCallbackFlags GUARDED_BY(mMutex) = 0;
135+
uint32_t mInputStreamCallbackRequestedCount GUARDED_BY(mMutex) = 0;
137136

138137
// These 2 values are set only if mState is ePending.
139-
nsCOMPtr<nsIFileMetadataCallback> mFileMetadataCallback
140-
MOZ_GUARDED_BY(mMutex);
141-
nsCOMPtr<nsIEventTarget> mFileMetadataCallbackEventTarget
142-
MOZ_GUARDED_BY(mMutex);
138+
nsCOMPtr<nsIFileMetadataCallback> mFileMetadataCallback GUARDED_BY(mMutex);
139+
nsCOMPtr<nsIEventTarget> mFileMetadataCallbackEventTarget GUARDED_BY(mMutex);
143140
};
144141

145142
} // namespace mozilla

dom/ipc/ProcessHangMonitor.cpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,22 +156,21 @@ class HangMonitorChild : public PProcessHangMonitorChild,
156156
bool mSentReport;
157157

158158
// These fields must be accessed with mMonitor held.
159-
bool mTerminateScript MOZ_GUARDED_BY(mMonitor);
160-
bool mStartDebugger MOZ_GUARDED_BY(mMonitor);
161-
bool mFinishedStartingDebugger MOZ_GUARDED_BY(mMonitor);
162-
bool mPaintWhileInterruptingJS MOZ_GUARDED_BY(mMonitor);
163-
TabId mPaintWhileInterruptingJSTab MOZ_GUARDED_BY(mMonitor);
159+
bool mTerminateScript GUARDED_BY(mMonitor);
160+
bool mStartDebugger GUARDED_BY(mMonitor);
161+
bool mFinishedStartingDebugger GUARDED_BY(mMonitor);
162+
bool mPaintWhileInterruptingJS GUARDED_BY(mMonitor);
163+
TabId mPaintWhileInterruptingJSTab GUARDED_BY(mMonitor);
164164
MOZ_INIT_OUTSIDE_CTOR LayersObserverEpoch mPaintWhileInterruptingJSEpoch
165-
MOZ_GUARDED_BY(mMonitor);
166-
bool mCancelContentJS MOZ_GUARDED_BY(mMonitor);
167-
TabId mCancelContentJSTab MOZ_GUARDED_BY(mMonitor);
165+
GUARDED_BY(mMonitor);
166+
bool mCancelContentJS GUARDED_BY(mMonitor);
167+
TabId mCancelContentJSTab GUARDED_BY(mMonitor);
168168
nsIRemoteTab::NavigationType mCancelContentJSNavigationType
169-
MOZ_GUARDED_BY(mMonitor);
170-
int32_t mCancelContentJSNavigationIndex MOZ_GUARDED_BY(mMonitor);
171-
mozilla::Maybe<nsCString> mCancelContentJSNavigationURI
172-
MOZ_GUARDED_BY(mMonitor);
173-
int32_t mCancelContentJSEpoch MOZ_GUARDED_BY(mMonitor);
174-
bool mShutdownDone MOZ_GUARDED_BY(mMonitor);
169+
GUARDED_BY(mMonitor);
170+
int32_t mCancelContentJSNavigationIndex GUARDED_BY(mMonitor);
171+
mozilla::Maybe<nsCString> mCancelContentJSNavigationURI GUARDED_BY(mMonitor);
172+
int32_t mCancelContentJSEpoch GUARDED_BY(mMonitor);
173+
bool mShutdownDone GUARDED_BY(mMonitor);
175174

176175
JSContext* mContext; // const after constructor
177176

@@ -294,14 +293,14 @@ class HangMonitorParent : public PProcessHangMonitorParent,
294293
RefPtr<HangMonitoredProcess> mProcess;
295294

296295
// Must be accessed with mMonitor held.
297-
bool mShutdownDone MOZ_GUARDED_BY(mMonitor);
296+
bool mShutdownDone GUARDED_BY(mMonitor);
298297
// Map from plugin ID to crash dump ID. Protected by
299298
// mBrowserCrashDumpHashLock.
300299
nsTHashMap<nsUint32HashKey, nsString> mBrowserCrashDumpIds
301-
MOZ_GUARDED_BY(mMonitor);
302-
Mutex mBrowserCrashDumpHashLock MOZ_GUARDED_BY(mMonitor);
300+
GUARDED_BY(mMonitor);
301+
Mutex mBrowserCrashDumpHashLock GUARDED_BY(mMonitor);
303302
mozilla::ipc::TaskFactory<HangMonitorParent> mMainThreadTaskFactory
304-
MOZ_GUARDED_BY(mMonitor);
303+
GUARDED_BY(mMonitor);
305304
};
306305

307306
} // namespace

dom/media/AudioStream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ int AudioStream::InvokeCubeb(Function aFunction, Args&&... aArgs) {
228228
}
229229

230230
nsresult AudioStream::Init(AudioDeviceInfo* aSinkInfo)
231-
MOZ_NO_THREAD_SAFETY_ANALYSIS {
231+
NO_THREAD_SAFETY_ANALYSIS {
232232
auto startTime = TimeStamp::Now();
233233
TRACE("AudioStream::Init");
234234

dom/media/AudioStream.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class AudioClock {
112112
// protected by the AudioStream monitor on other platforms.
113113
const UniquePtr<FrameHistory> mFrameHistory
114114
# ifndef XP_MACOSX
115-
MOZ_GUARDED_BY(mMutex)
115+
GUARDED_BY(mMutex)
116116
# endif
117117
;
118118
# ifdef XP_MACOSX
@@ -335,10 +335,10 @@ class AudioStream final {
335335

336336
// Return true if audio frames are valid (correct sampling rate and valid
337337
// channel count) otherwise false.
338-
bool IsValidAudioFormat(Chunk* aChunk) MOZ_REQUIRES(mMonitor);
338+
bool IsValidAudioFormat(Chunk* aChunk) REQUIRES(mMonitor);
339339

340340
template <typename Function, typename... Args>
341-
int InvokeCubeb(Function aFunction, Args&&... aArgs) MOZ_REQUIRES(mMonitor);
341+
int InvokeCubeb(Function aFunction, Args&&... aArgs) REQUIRES(mMonitor);
342342
bool CheckThreadIdChanged();
343343
void AssertIsOnAudioThread() const;
344344

@@ -382,8 +382,7 @@ class AudioStream final {
382382
std::atomic<ProfilerThreadId> mAudioThreadId;
383383
const bool mSandboxed = false;
384384

385-
MozPromiseHolder<MediaSink::EndedPromise> mEndedPromise
386-
MOZ_GUARDED_BY(mMonitor);
385+
MozPromiseHolder<MediaSink::EndedPromise> mEndedPromise GUARDED_BY(mMonitor);
387386
std::atomic<bool> mPlaybackComplete;
388387
// Both written on the MDSM thread, read on the audio thread.
389388
std::atomic<float> mPlaybackRate;

0 commit comments

Comments
 (0)