Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE

This commit is contained in:
Butkovits Atila
2022-03-16 14:38:14 +02:00
parent fe15f2115d
commit 01197944a0
441 changed files with 549 additions and 573 deletions

View File

@@ -115,7 +115,7 @@ class HandlerProvider final : public IGeckoBackChannel,
HRESULT* result); HRESULT* result);
Atomic<uint32_t> mRefCnt; Atomic<uint32_t> mRefCnt;
Mutex mMutex MOZ_UNANNOTATED; // Protects mSerializer Mutex mMutex; // Protects mSerializer
const IID mTargetUnkIid; const IID mTargetUnkIid;
mscom::InterceptorTargetPtr<IUnknown> mscom::InterceptorTargetPtr<IUnknown>
mTargetUnk; // Constant, main thread only mTargetUnk; // Constant, main thread only
@@ -136,7 +136,7 @@ class HandlerProvider final : public IGeckoBackChannel,
// Used when the payload is built prior to marshaling the object by a bulk // Used when the payload is built prior to marshaling the object by a bulk
// fetch operation. See prebuildPayload(). // fetch operation. See prebuildPayload().
IA2PayloadPtr mPayload; IA2PayloadPtr mPayload;
Mutex mPayloadMutex MOZ_UNANNOTATED; // Protects mPayload Mutex mPayloadMutex; // Protects mPayload
}; };
} // namespace a11y } // namespace a11y

View File

@@ -40,7 +40,7 @@ class MarkersStorage : public LinkedListElement<MarkersStorage> {
Mutex& GetLock(); Mutex& GetLock();
private: private:
Mutex mLock MOZ_UNANNOTATED; Mutex mLock;
}; };
} // namespace mozilla } // namespace mozilla

View File

@@ -123,7 +123,7 @@ class TimelineConsumers : public nsIObserver {
LinkedList<MarkersStorage> mMarkersStores; LinkedList<MarkersStorage> mMarkersStores;
// Protects this class's data structures. // Protects this class's data structures.
static StaticMutex sMutex MOZ_UNANNOTATED; static StaticMutex sMutex;
}; };
} // namespace mozilla } // namespace mozilla

View File

@@ -227,7 +227,7 @@ class BodyStream final : public nsIInputStreamCallback,
// We need a mutex because JS engine can release BodyStream on a non-owning // We need a mutex because JS engine can release BodyStream on a non-owning
// thread. We must be sure that the releasing of resources doesn't trigger // thread. We must be sure that the releasing of resources doesn't trigger
// race conditions. // race conditions.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// Protected by mutex. // Protected by mutex.
State mState; State mState;

View File

@@ -1101,7 +1101,7 @@ class Manager::CachePutAllAction final : public DBAction {
nsTArray<nsID> mDeletedBodyIdList; nsTArray<nsID> mDeletedBodyIdList;
// accessed from any thread while mMutex locked // accessed from any thread while mMutex locked
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
nsTArray<nsCOMPtr<nsISupports>> mCopyContextList; nsTArray<nsCOMPtr<nsISupports>> mCopyContextList;
Maybe<CacheDirectoryMetadata> mDirectoryMetadata; Maybe<CacheDirectoryMetadata> mDirectoryMetadata;

View File

@@ -105,7 +105,7 @@ class ReadStream::Inner final : public ReadStream::Controllable {
// to close a stream on our owning thread while an IO thread is simultaneously // to close a stream on our owning thread while an IO thread is simultaneously
// reading the same stream. Therefore, protect all access to these stream // reading the same stream. Therefore, protect all access to these stream
// objects with a mutex. // objects with a mutex.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
CondVar mCondVar; CondVar mCondVar;
nsCOMPtr<nsIInputStream> mStream; nsCOMPtr<nsIInputStream> mStream;
nsCOMPtr<nsIInputStream> mSnappyStream; nsCOMPtr<nsIInputStream> mSnappyStream;

View File

@@ -32,7 +32,7 @@ namespace mozilla {
// - // -
static StaticMutex sContextSetLock MOZ_UNANNOTATED; static StaticMutex sContextSetLock;
static std::unordered_set<HostWebGLContext*>& DeferredStaticContextSet() { static std::unordered_set<HostWebGLContext*>& DeferredStaticContextSet() {
static std::unordered_set<HostWebGLContext*> sContextSet; static std::unordered_set<HostWebGLContext*> sContextSet;

View File

@@ -1475,7 +1475,7 @@ class CreateImageBitmapFromBlob final : public DiscardableRunnable,
// This is called on the main-thread only. // This is called on the main-thread only.
nsresult GetMimeTypeAsync(); nsresult GetMimeTypeAsync();
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// The access to this object is protected by mutex but is always nullified on // The access to this object is protected by mutex but is always nullified on
// the owning thread. // the owning thread.

View File

@@ -62,7 +62,7 @@ class OffscreenCanvasDisplayHelper final {
gfx::SurfaceFormat aFormat, const gfx::IntSize& aSize, gfx::SurfaceFormat aFormat, const gfx::IntSize& aSize,
bool aNeedsPremult, gl::OriginPos aOriginPos) const; bool aNeedsPremult, gl::OriginPos aOriginPos) const;
mutable Mutex mMutex MOZ_UNANNOTATED; mutable Mutex mMutex;
HTMLCanvasElement* MOZ_NON_OWNING_REF mCanvasElement; HTMLCanvasElement* MOZ_NON_OWNING_REF mCanvasElement;
RefPtr<layers::ImageContainer> mImageContainer; RefPtr<layers::ImageContainer> mImageContainer;
RefPtr<gfx::SourceSurface> mFrontBufferSurface; RefPtr<gfx::SourceSurface> mFrontBufferSurface;

View File

@@ -78,7 +78,7 @@ class ConsoleReportCollector final : public nsIConsoleReportCollector {
const CopyableTArray<nsString> mStringParams; const CopyableTArray<nsString> mStringParams;
}; };
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// protected by mMutex // protected by mMutex
nsTArray<PendingReport> mPendingReports; nsTArray<PendingReport> mPendingReports;

View File

@@ -131,7 +131,7 @@ class FileBlobImpl : public BlobImpl {
// FileBlobImpl has getter methods with lazy initialization. Because any // FileBlobImpl has getter methods with lazy initialization. Because any
// BlobImpl must work thread-safe, we use a mutex. // BlobImpl must work thread-safe, we use a mutex.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
nsCOMPtr<nsIFile> mFile; nsCOMPtr<nsIFile> mFile;

View File

@@ -97,7 +97,7 @@ class MemoryBlobImpl final : public BaseBlobImpl {
// sDataOwners and sMemoryReporterRegistered may only be accessed while // sDataOwners and sMemoryReporterRegistered may only be accessed while
// holding sDataOwnerMutex! You also must hold the mutex while touching // holding sDataOwnerMutex! You also must hold the mutex while touching
// elements of the linked list that DataOwner inherits from. // elements of the linked list that DataOwner inherits from.
static mozilla::StaticMutex sDataOwnerMutex MOZ_UNANNOTATED; static mozilla::StaticMutex sDataOwnerMutex;
static mozilla::StaticAutoPtr<mozilla::LinkedList<DataOwner> > sDataOwners; static mozilla::StaticAutoPtr<mozilla::LinkedList<DataOwner> > sDataOwners;
static bool sMemoryReporterRegistered; static bool sMemoryReporterRegistered;

View File

@@ -92,7 +92,7 @@ class MutableBlobStorage final {
[[nodiscard]] nsresult DispatchToIOThread( [[nodiscard]] nsresult DispatchToIOThread(
already_AddRefed<nsIRunnable> aRunnable); already_AddRefed<nsIRunnable> aRunnable);
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// All these variables are touched on the main thread only or in the // All these variables are touched on the main thread only or in the
// retargeted thread when used by Append(). They are protected by mMutex. // retargeted thread when used by Append(). They are protected by mMutex.

View File

@@ -115,7 +115,7 @@ class RemoteLazyInputStream final : public nsIAsyncInputStream,
// Any member of this class is protected by mutex because touched on // Any member of this class is protected by mutex because touched on
// multiple threads. // multiple threads.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
}; };
} // namespace mozilla } // namespace mozilla

View File

@@ -78,7 +78,7 @@ class RemoteLazyInputStreamChild final : public PRemoteLazyInputStreamChild {
nsTArray<RemoteLazyInputStream*> mStreams; nsTArray<RemoteLazyInputStream*> mStreams;
// This mutex protects mStreams because that can be touched in any thread. // This mutex protects mStreams because that can be touched in any thread.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
const nsID mID; const nsID mID;
const uint64_t mSize; const uint64_t mSize;

View File

@@ -60,7 +60,7 @@ class BlobURLInputStream final : public nsIAsyncInputStream,
// Non-recursive mutex introduced in order to guard access to mState, mError // Non-recursive mutex introduced in order to guard access to mState, mError
// and mAsyncInputStream // and mAsyncInputStream
Mutex mStateMachineMutex MOZ_UNANNOTATED; Mutex mStateMachineMutex;
State mState; State mState;
// Stores the error code if stream is in error state // Stores the error code if stream is in error state
nsresult mError; nsresult mError;

View File

@@ -87,7 +87,7 @@ struct DataInfo {
// The mutex is locked whenever gDataTable is changed, or if gDataTable // The mutex is locked whenever gDataTable is changed, or if gDataTable
// is accessed off-main-thread. // is accessed off-main-thread.
static StaticMutex sMutex MOZ_UNANNOTATED; static StaticMutex sMutex;
// All changes to gDataTable must happen on the main thread, while locking // All changes to gDataTable must happen on the main thread, while locking
// sMutex. Reading from gDataTable on the main thread may happen without // sMutex. Reading from gDataTable on the main thread may happen without

View File

@@ -118,7 +118,7 @@ class GetFilesHelper : public Runnable, public GetFilesHelperBase {
nsTArray<RefPtr<Promise>> mPromises; nsTArray<RefPtr<Promise>> mPromises;
nsTArray<RefPtr<GetFilesCallback>> mCallbacks; nsTArray<RefPtr<GetFilesCallback>> mCallbacks;
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// This variable is protected by mutex. // This variable is protected by mutex.
bool mCanceled; bool mCanceled;

View File

@@ -141,7 +141,7 @@ class GamepadPlatformService final {
// This mutex protects mChannelParents from race condition // This mutex protects mChannelParents from race condition
// between background and monitor thread // between background and monitor thread
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
std::map<GamepadHandle, GamepadAdded> mGamepadAdded; std::map<GamepadHandle, GamepadAdded> mGamepadAdded;
}; };

View File

@@ -1497,7 +1497,7 @@ class ConnectionPool final {
}; };
// This mutex guards mDatabases, see below. // This mutex guards mDatabases, see below.
Mutex mDatabasesMutex MOZ_UNANNOTATED; Mutex mDatabasesMutex;
nsTArray<IdleThreadInfo> mIdleThreads; nsTArray<IdleThreadInfo> mIdleThreads;
nsTArray<IdleDatabaseInfo> mIdleDatabases; nsTArray<IdleDatabaseInfo> mIdleDatabases;
@@ -6592,7 +6592,7 @@ nsresult DispatchAndReturnFileReferences(
*aMemRefCnt = -1; *aMemRefCnt = -1;
*aDBRefCnt = -1; *aDBRefCnt = -1;
mozilla::Monitor monitor MOZ_ANNOTATED(__func__); mozilla::Monitor monitor(__func__);
bool waiting = true; bool waiting = true;
auto lambda = [&] { auto lambda = [&] {
@@ -6758,7 +6758,7 @@ class DeserializeIndexValueHelper final : public Runnable {
lock.Notify(); lock.Notify();
} }
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
const int64_t mIndexID; const int64_t mIndexID;
const KeyPath& mKeyPath; const KeyPath& mKeyPath;
@@ -21682,7 +21682,7 @@ class FileHelper::ReadCallback final : public nsIInputStreamCallback {
private: private:
~ReadCallback() = default; ~ReadCallback() = default;
mozilla::Mutex mMutex MOZ_UNANNOTATED; mozilla::Mutex mMutex;
mozilla::CondVar mCondVar; mozilla::CondVar mCondVar;
bool mInputAvailable; bool mInputAvailable;
}; };

View File

@@ -2842,7 +2842,7 @@ class DeserializeUpgradeValueHelper final : public Runnable {
lock.Notify(); lock.Notify();
} }
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
StructuredCloneReadInfoParent& mCloneReadInfo; StructuredCloneReadInfoParent& mCloneReadInfo;
nsresult mStatus; nsresult mStatus;
}; };

View File

@@ -148,7 +148,7 @@ class HangMonitorChild : public PProcessHangMonitorChild,
static Atomic<HangMonitorChild*, SequentiallyConsistent> sInstance; static Atomic<HangMonitorChild*, SequentiallyConsistent> sInstance;
const RefPtr<ProcessHangMonitor> mHangMonitor; const RefPtr<ProcessHangMonitor> mHangMonitor;
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
// Main thread-only. // Main thread-only.
bool mSentReport; bool mSentReport;
@@ -282,7 +282,7 @@ class HangMonitorParent : public PProcessHangMonitorParent,
// This field is only accessed on the hang thread. // This field is only accessed on the hang thread.
bool mIPCOpen; bool mIPCOpen;
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
// Must be accessed with mMonitor held. // Must be accessed with mMonitor held.
RefPtr<HangMonitoredProcess> mProcess; RefPtr<HangMonitoredProcess> mProcess;
@@ -290,7 +290,7 @@ class HangMonitorParent : public PProcessHangMonitorParent,
// Map from plugin ID to crash dump ID. Protected by // Map from plugin ID to crash dump ID. Protected by
// mBrowserCrashDumpHashLock. // mBrowserCrashDumpHashLock.
nsTHashMap<nsUint32HashKey, nsString> mBrowserCrashDumpIds; nsTHashMap<nsUint32HashKey, nsString> mBrowserCrashDumpIds;
Mutex mBrowserCrashDumpHashLock MOZ_UNANNOTATED; Mutex mBrowserCrashDumpHashLock;
mozilla::ipc::TaskFactory<HangMonitorParent> mMainThreadTaskFactory; mozilla::ipc::TaskFactory<HangMonitorParent> mMainThreadTaskFactory;
}; };

View File

@@ -96,7 +96,7 @@ class RefMessageBody final {
// In case the RefMessageBody is shared and refcounted (see mCount/mMaxCount), // In case the RefMessageBody is shared and refcounted (see mCount/mMaxCount),
// we must enforce that the reading does not happen simultaneously on // we must enforce that the reading does not happen simultaneously on
// different threads. // different threads.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
UniquePtr<ipc::StructuredCloneData> mCloneData; UniquePtr<ipc::StructuredCloneData> mCloneData;

View File

@@ -1368,7 +1368,7 @@ class Connection final : public CachingDatabaseConnection {
* origin, so we need to queue a runnable and wait our turn.) * origin, so we need to queue a runnable and wait our turn.)
*/ */
class Connection::InitTemporaryOriginHelper final : public Runnable { class Connection::InitTemporaryOriginHelper final : public Runnable {
mozilla::Monitor mMonitor MOZ_UNANNOTATED; mozilla::Monitor mMonitor;
const OriginMetadata mOriginMetadata; const OriginMetadata mOriginMetadata;
nsString mOriginDirectoryPath; nsString mOriginDirectoryPath;
nsresult mIOThreadResultCode; nsresult mIOThreadResultCode;
@@ -2614,7 +2614,7 @@ class QuotaClient final : public mozilla::dom::quota::Client {
static QuotaClient* sInstance; static QuotaClient* sInstance;
Mutex mShadowDatabaseMutex MOZ_UNANNOTATED; Mutex mShadowDatabaseMutex;
bool mShutdownRequested; bool mShutdownRequested;
public: public:

View File

@@ -329,7 +329,7 @@ class AudioStream final {
soundtouch::SoundTouch* mTimeStretcher; soundtouch::SoundTouch* mTimeStretcher;
// The monitor is held to protect all access to member variables below. // The monitor is held to protect all access to member variables below.
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
const uint32_t mOutChannels; const uint32_t mOutChannels;
const AudioConfig::ChannelLayout::ChannelMap mChannelMap; const AudioConfig::ChannelLayout::ChannelMap mChannelMap;

View File

@@ -79,7 +79,7 @@ bool VP9Benchmark::IsVP9DecodeFast(bool aDefault) {
if (!ShouldRun()) { if (!ShouldRun()) {
return false; return false;
} }
static StaticMutex sMutex MOZ_UNANNOTATED; static StaticMutex sMutex;
uint32_t decodeFps = StaticPrefs::media_benchmark_vp9_fps(); uint32_t decodeFps = StaticPrefs::media_benchmark_vp9_fps();
uint32_t hadRecentUpdate = StaticPrefs::media_benchmark_vp9_versioncheck(); uint32_t hadRecentUpdate = StaticPrefs::media_benchmark_vp9_versioncheck();
bool needBenchmark; bool needBenchmark;

View File

@@ -186,7 +186,7 @@ class ChannelMediaResource
void Revoke(); void Revoke();
private: private:
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// mResource should only be modified on the main thread with the lock. // mResource should only be modified on the main thread with the lock.
// So it can be read without lock on the main thread or on other threads // So it can be read without lock on the main thread or on other threads
// with the lock. // with the lock.

View File

@@ -113,7 +113,7 @@ class InputStreamReader final : public nsIInputStreamCallback {
nsCOMPtr<nsIInputStream> mStream; nsCOMPtr<nsIInputStream> mStream;
nsCOMPtr<nsIAsyncInputStream> mAsyncStream; nsCOMPtr<nsIAsyncInputStream> mAsyncStream;
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
}; };
NS_IMPL_ADDREF(InputStreamReader); NS_IMPL_ADDREF(InputStreamReader);

View File

@@ -140,7 +140,7 @@ class FileBlockCache : public MediaBlockCacheBase {
// Mutex which controls access to mFD and mFDCurrentPos. Don't hold // Mutex which controls access to mFD and mFDCurrentPos. Don't hold
// mDataMutex while holding mFileMutex! mFileMutex must be owned // mDataMutex while holding mFileMutex! mFileMutex must be owned
// while accessing any of the following data fields or methods. // while accessing any of the following data fields or methods.
Mutex mFileMutex MOZ_UNANNOTATED; Mutex mFileMutex;
// Moves a block already committed to file. // Moves a block already committed to file.
nsresult MoveBlockInFile(int32_t aSourceBlockIndex, int32_t aDestBlockIndex); nsresult MoveBlockInFile(int32_t aSourceBlockIndex, int32_t aDestBlockIndex);
// Seeks file pointer. // Seeks file pointer.
@@ -159,7 +159,7 @@ class FileBlockCache : public MediaBlockCacheBase {
// and mFDCurrentPos. Don't hold mDataMutex while holding mFileMutex! // and mFDCurrentPos. Don't hold mDataMutex while holding mFileMutex!
// mDataMutex must be owned while accessing any of the following data // mDataMutex must be owned while accessing any of the following data
// fields or methods. // fields or methods.
Mutex mDataMutex MOZ_UNANNOTATED; Mutex mDataMutex;
// Ensures we either are running the event to preform IO, or an event // Ensures we either are running the event to preform IO, or an event
// has been dispatched to preform the IO. // has been dispatched to preform the IO.
// mDataMutex must be owned while calling this. // mDataMutex must be owned while calling this.

View File

@@ -109,7 +109,7 @@ class FileMediaResource : public BaseMediaResource {
// Read or Seek is in progress since it resets various internal // Read or Seek is in progress since it resets various internal
// values to null. // values to null.
// This lock protects mSeekable, mInput, mSize, and mSizeInitialized. // This lock protects mSeekable, mInput, mSize, and mSizeInitialized.
Mutex mLock MOZ_UNANNOTATED; Mutex mLock;
// Seekable stream interface to file. This can be used from any // Seekable stream interface to file. This can be used from any
// thread. // thread.

View File

@@ -171,7 +171,7 @@ class FrameStatistics {
~FrameStatistics() = default; ~FrameStatistics() = default;
// ReentrantMonitor to protect access of playback statistics. // ReentrantMonitor to protect access of playback statistics.
mutable ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; mutable ReentrantMonitor mReentrantMonitor;
FrameStatisticsData mFrameStatisticsData; FrameStatisticsData mFrameStatisticsData;
}; };

View File

@@ -377,7 +377,7 @@ class MediaTrackGraphInitThreadRunnable;
*/ */
class ThreadedDriver : public GraphDriver { class ThreadedDriver : public GraphDriver {
class IterationWaitHelper { class IterationWaitHelper {
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
// The below members are guarded by mMonitor. // The below members are guarded by mMonitor.
bool mNeedAnotherIteration = false; bool mNeedAnotherIteration = false;
TimeStamp mWakeTime; TimeStamp mWakeTime;

View File

@@ -80,7 +80,7 @@ class GraphRunner final : public Runnable {
// Monitor used for yielding mThread through Wait(), and scheduling mThread // Monitor used for yielding mThread through Wait(), and scheduling mThread
// through Signal() from a GraphDriver. // through Signal() from a GraphDriver.
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
// The MediaTrackGraph we're running. Weakptr beecause this graph owns us and // The MediaTrackGraph we're running. Weakptr beecause this graph owns us and
// guarantees that our lifetime will not go beyond that of itself. // guarantees that our lifetime will not go beyond that of itself.
MediaTrackGraphImpl* const mGraph; MediaTrackGraphImpl* const mGraph;

View File

@@ -443,7 +443,7 @@ class MediaCache {
// The monitor protects all the data members here. Also, off-main-thread // The monitor protects all the data members here. Also, off-main-thread
// readers that need to block will Wait() on this monitor. When new // readers that need to block will Wait() on this monitor. When new
// data becomes available in the cache, we NotifyAll() on this monitor. // data becomes available in the cache, we NotifyAll() on this monitor.
mozilla::Monitor mMonitor MOZ_UNANNOTATED; mozilla::Monitor mMonitor;
// This must always be accessed when the monitor is held. // This must always be accessed when the monitor is held.
nsTArray<MediaCacheStream*> mStreams; nsTArray<MediaCacheStream*> mStreams;
// The Blocks describing the cache entries. // The Blocks describing the cache entries.

View File

@@ -475,7 +475,7 @@ class MediaEventSourceImpl {
} }
private: private:
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
nsTArray<RefPtr<Listener>> mListeners; nsTArray<RefPtr<Listener>> mListeners;
}; };

View File

@@ -718,7 +718,7 @@ class MediaFormatReader::DemuxerProxy::Wrapper : public MediaTrackDemuxer {
void BreakCycles() override {} void BreakCycles() override {}
private: private:
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
const RefPtr<TaskQueue> mTaskQueue; const RefPtr<TaskQueue> mTaskQueue;
const bool mGetSamplesMayBlock; const bool mGetSamplesMayBlock;
const UniquePtr<TrackInfo> mInfo; const UniquePtr<TrackInfo> mInfo;

View File

@@ -392,7 +392,7 @@ class MediaFormatReader final
// as those can be read outside the TaskQueue. // as those can be read outside the TaskQueue.
// They are only written on the TaskQueue however, as such mMutex doesn't // They are only written on the TaskQueue however, as such mMutex doesn't
// need to be held when those members are read on the TaskQueue. // need to be held when those members are read on the TaskQueue.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// The platform decoder. // The platform decoder.
RefPtr<MediaDataDecoder> mDecoder; RefPtr<MediaDataDecoder> mDecoder;
nsCString mDescription; nsCString mDescription;

View File

@@ -391,7 +391,7 @@ class MediaManager final : public nsIMediaManagerService,
RefPtr<MediaEngine> mBackend; RefPtr<MediaEngine> mBackend;
static StaticRefPtr<MediaManager> sSingleton; static StaticRefPtr<MediaManager> sSingleton;
static StaticMutex sSingletonMutex MOZ_UNANNOTATED; static StaticMutex sSingletonMutex;
// Connect/Disconnect on media thread only // Connect/Disconnect on media thread only
MediaEventListener mDeviceListChangeListener; MediaEventListener mDeviceListChangeListener;

View File

@@ -179,7 +179,7 @@ class MediaQueue : private nsRefPtrDeque<T> {
} }
} }
mutable RecursiveMutex mRecursiveMutex MOZ_UNANNOTATED; mutable RecursiveMutex mRecursiveMutex;
MediaEventProducer<RefPtr<T>> mPopFrontEvent; MediaEventProducer<RefPtr<T>> mPopFrontEvent;
MediaEventProducer<RefPtr<T>> mPushEvent; MediaEventProducer<RefPtr<T>> mPushEvent;
MediaEventProducer<void> mFinishEvent; MediaEventProducer<void> mFinishEvent;

View File

@@ -95,7 +95,7 @@ class MediaTimer {
nsCOMPtr<nsIEventTarget> mThread; nsCOMPtr<nsIEventTarget> mThread;
std::priority_queue<Entry> mEntries; std::priority_queue<Entry> mEntries;
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
nsCOMPtr<nsITimer> mTimer; nsCOMPtr<nsITimer> mTimer;
TimeStamp mCurrentTimerTarget; TimeStamp mCurrentTimerTarget;

View File

@@ -733,7 +733,7 @@ class SourceMediaTrack : public MediaTrack {
// This must be acquired *before* MediaTrackGraphImpl's lock, if they are // This must be acquired *before* MediaTrackGraphImpl's lock, if they are
// held together. // held together.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// protected by mMutex // protected by mMutex
float mVolume = 1.0; float mVolume = 1.0;
UniquePtr<TrackData> mUpdateTrack; UniquePtr<TrackData> mUpdateTrack;

View File

@@ -767,7 +767,7 @@ class MediaTrackGraphImpl : public MediaTrackGraph,
// not safe to just grab mMonitor from some thread and start monkeying with // not safe to just grab mMonitor from some thread and start monkeying with
// the graph. Instead, communicate with the graph thread using provided // the graph. Instead, communicate with the graph thread using provided
// mechanisms such as the ControlMessage queue. // mechanisms such as the ControlMessage queue.
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
// Data guarded by mMonitor (must always be accessed with mMonitor held, // Data guarded by mMonitor (must always be accessed with mMonitor held,
// regardless of the value of mLifecycleState). // regardless of the value of mLifecycleState).

View File

@@ -76,7 +76,7 @@ class MemoryBlockCache : public MediaBlockCacheBase {
const size_t mMaxBlocks; const size_t mMaxBlocks;
// Mutex which controls access to all members below. // Mutex which controls access to all members below.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
nsTArray<uint8_t> mBuffer; nsTArray<uint8_t> mBuffer;
bool mHasGrown = false; bool mHasGrown = false;

View File

@@ -117,7 +117,7 @@ class VideoFrameContainer {
} mMainThreadState; } mMainThreadState;
// mMutex protects all the fields below. // mMutex protects all the fields below.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// The intrinsic size is the ideal size which we should render the // The intrinsic size is the ideal size which we should render the
// ImageContainer's current Image at. // ImageContainer's current Image at.
// This can differ from the Image's actual size when the media resource // This can differ from the Image's actual size when the media resource

View File

@@ -213,7 +213,7 @@ class VideoOutput : public DirectMediaTrackListener {
} }
} }
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
TimeStamp mLastFrameTime; TimeStamp mLastFrameTime;
// Once the frame is forced to black, we initialize mBlackImage for use in any // Once the frame is forced to black, we initialize mBlackImage for use in any
// following forced-black frames. // following forced-black frames.

View File

@@ -175,7 +175,7 @@ struct DDMediaLogs {
nsTArray<DDObjectLink> mObjectLinks; nsTArray<DDObjectLink> mObjectLinks;
// Protects members below. // Protects members below.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// Processing thread. // Processing thread.
nsCOMPtr<nsIThread> mThread; nsCOMPtr<nsIThread> mThread;

View File

@@ -28,7 +28,7 @@ class MultiWriterQueueReaderLocking_Mutex {
void Unlock() { mMutex.Unlock(); }; void Unlock() { mMutex.Unlock(); };
private: private:
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
}; };
// Reader non-locking strategy, trusting that PopAll will never be called // Reader non-locking strategy, trusting that PopAll will never be called

View File

@@ -330,7 +330,7 @@ struct DequeWrapperAW : DequeWrapperST {
// Multi-thread writes allowed, make sure you don't pop unless writes can't // Multi-thread writes allowed, make sure you don't pop unless writes can't
// happen. // happen.
struct DequeWrapperMW : DequeWrapperST { struct DequeWrapperMW : DequeWrapperST {
mozilla::Mutex mMutex MOZ_UNANNOTATED; mozilla::Mutex mMutex;
DequeWrapperMW() : mMutex("DequeWrapperMW/MT") {} DequeWrapperMW() : mMutex("DequeWrapperMW/MT") {}

View File

@@ -131,7 +131,7 @@ class ChromiumCDMProxy : public CDMProxy {
RefPtr<GMPCrashHelper> mCrashHelper; RefPtr<GMPCrashHelper> mCrashHelper;
Mutex mCDMMutex MOZ_UNANNOTATED; Mutex mCDMMutex;
RefPtr<gmp::ChromiumCDMParent> mCDM; RefPtr<gmp::ChromiumCDMParent> mCDM;
nsCOMPtr<nsISerialEventTarget> mGMPThread; nsCOMPtr<nsISerialEventTarget> mGMPThread;
UniquePtr<ChromiumCDMCallbackProxy> mCallback; UniquePtr<ChromiumCDMCallbackProxy> mCallback;

View File

@@ -86,7 +86,7 @@ class GMPSyncRunnable final {
bool mDone; bool mDone;
GMPTask* mTask; GMPTask* mTask;
MessageLoop* mMessageLoop; MessageLoop* mMessageLoop;
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
}; };
class GMPThreadImpl : public GMPThread { class GMPThreadImpl : public GMPThread {
@@ -99,7 +99,7 @@ class GMPThreadImpl : public GMPThread {
void Join() override; void Join() override;
private: private:
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
base::Thread mThread; base::Thread mThread;
}; };
@@ -148,7 +148,7 @@ class GMPMutexImpl : public GMPMutex {
void Destroy() override; void Destroy() override;
private: private:
ReentrantMonitor mMonitor MOZ_UNANNOTATED; ReentrantMonitor mMonitor;
}; };
GMPErr CreateMutex(GMPMutex** aMutex) { GMPErr CreateMutex(GMPMutex** aMutex) {

View File

@@ -106,9 +106,8 @@ class GeckoMediaPluginService : public mozIGeckoMediaPluginService,
static nsCOMPtr<nsIAsyncShutdownClient> GetShutdownBarrier(); static nsCOMPtr<nsIAsyncShutdownClient> GetShutdownBarrier();
Mutex mMutex MOZ_UNANNOTATED; // Protects mGMPThread, mPluginCrashHelpers, Mutex mMutex; // Protects mGMPThread, mPluginCrashHelpers,
// mGMPThreadShutdown and some members in // mGMPThreadShutdown and some members in derived classes.
// derived classes.
const nsCOMPtr<nsISerialEventTarget> mMainThread; const nsCOMPtr<nsISerialEventTarget> mMainThread;

View File

@@ -211,7 +211,7 @@ class GeckoMediaPluginServiceParent final
// Synchronization for barrier that ensures we've loaded GMPs from // Synchronization for barrier that ensures we've loaded GMPs from
// MOZ_GMP_PATH before allowing GetContentParentFrom() to proceed. // MOZ_GMP_PATH before allowing GetContentParentFrom() to proceed.
Monitor mInitPromiseMonitor MOZ_UNANNOTATED; Monitor mInitPromiseMonitor;
MozMonitoredPromiseHolder<GenericPromise> mInitPromise; MozMonitoredPromiseHolder<GenericPromise> mInitPromise;
bool mLoadPluginsFromDiskComplete; bool mLoadPluginsFromDiskComplete;

View File

@@ -84,7 +84,7 @@ class GMPStorageChild : public PGMPStorageChild {
mozilla::ipc::IPCResult RecvShutdown(); mozilla::ipc::IPCResult RecvShutdown();
private: private:
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
nsRefPtrHashtable<nsCStringHashKey, GMPRecordImpl> mRecords; nsRefPtrHashtable<nsCStringHashKey, GMPRecordImpl> mRecords;
GMPChild* mPlugin; GMPChild* mPlugin;
bool mShutdown; bool mShutdown;

View File

@@ -182,7 +182,7 @@ class MockCubebStream {
private: private:
// Monitor used to block start until mFrozenStart is false. // Monitor used to block start until mFrozenStart is false.
Monitor mFrozenStartMonitor MOZ_UNANNOTATED; Monitor mFrozenStartMonitor;
// Whether this stream should wait for an explicit start request before // Whether this stream should wait for an explicit start request before
// starting. Protected by FrozenStartMonitor. // starting. Protected by FrozenStartMonitor.
bool mFrozenStart; bool mFrozenStart;

View File

@@ -1150,7 +1150,7 @@ class CDMStorageTest {
nsTArray<ExpectedMessage> mExpected; nsTArray<ExpectedMessage> mExpected;
RefPtr<gmp::ChromiumCDMParent> mCDM; RefPtr<gmp::ChromiumCDMParent> mCDM;
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
Atomic<bool> mFinished; Atomic<bool> mFinished;
nsCString mNodeId; nsCString mNodeId;

View File

@@ -21,7 +21,7 @@ static const int64_t gEndOffsets[] = {501, 772, 1244, 1380, 1543, 2015};
TEST(WebMBuffered, BasicTests) TEST(WebMBuffered, BasicTests)
{ {
ReentrantMonitor dummy MOZ_UNANNOTATED("dummy"); ReentrantMonitor dummy("dummy");
WebMBufferedParser parser(0); WebMBufferedParser parser(0);
nsTArray<WebMTimeDataOffset> mapping; nsTArray<WebMTimeDataOffset> mapping;
@@ -60,7 +60,7 @@ static void ReadFile(const char* aPath, nsTArray<uint8_t>& aBuffer) {
TEST(WebMBuffered, RealData) TEST(WebMBuffered, RealData)
{ {
ReentrantMonitor dummy MOZ_UNANNOTATED("dummy"); ReentrantMonitor dummy("dummy");
WebMBufferedParser parser(0); WebMBufferedParser parser(0);
nsTArray<uint8_t> webmData; nsTArray<uint8_t> webmData;
@@ -82,7 +82,7 @@ TEST(WebMBuffered, RealData)
TEST(WebMBuffered, RealDataAppend) TEST(WebMBuffered, RealDataAppend)
{ {
ReentrantMonitor dummy MOZ_UNANNOTATED("dummy"); ReentrantMonitor dummy("dummy");
WebMBufferedParser parser(0); WebMBufferedParser parser(0);
nsTArray<WebMTimeDataOffset> mapping; nsTArray<WebMTimeDataOffset> mapping;

View File

@@ -44,7 +44,7 @@ class HLSResourceCallbacksSupport
private: private:
~HLSResourceCallbacksSupport() {} ~HLSResourceCallbacksSupport() {}
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
HLSDecoder* mDecoder; HLSDecoder* mDecoder;
}; };

View File

@@ -119,7 +119,7 @@ class HLSDemuxer::HLSDemuxerCallbacksSupport
mDemuxer = nullptr; mDemuxer = nullptr;
} }
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
private: private:
~HLSDemuxerCallbacksSupport() {} ~HLSDemuxerCallbacksSupport() {}

View File

@@ -127,7 +127,7 @@ class HLSTrackDemuxer : public MediaTrackDemuxer,
RefPtr<MediaRawData> mQueuedSample; RefPtr<MediaRawData> mQueuedSample;
// Mutex to protect members below across multiple threads. // Mutex to protect members below across multiple threads.
mutable Mutex mMutex MOZ_UNANNOTATED; mutable Mutex mMutex;
UniquePtr<TrackInfo> mTrackInfo; UniquePtr<TrackInfo> mTrackInfo;
}; };

View File

@@ -116,7 +116,7 @@ class WebMContainerParser
WebMBufferedParser parser(0); WebMBufferedParser parser(0);
nsTArray<WebMTimeDataOffset> mapping; nsTArray<WebMTimeDataOffset> mapping;
ReentrantMonitor dummy MOZ_ANNOTATED("dummy"); ReentrantMonitor dummy("dummy");
bool result = bool result =
parser.Append(aData.Elements(), aData.Length(), mapping, dummy); parser.Append(aData.Elements(), aData.Length(), mapping, dummy);
if (!result) { if (!result) {
@@ -134,7 +134,7 @@ class WebMContainerParser
WebMBufferedParser parser(0); WebMBufferedParser parser(0);
nsTArray<WebMTimeDataOffset> mapping; nsTArray<WebMTimeDataOffset> mapping;
ReentrantMonitor dummy MOZ_ANNOTATED("dummy"); ReentrantMonitor dummy("dummy");
parser.AppendMediaSegmentOnly(); parser.AppendMediaSegmentOnly();
bool result = bool result =
parser.Append(aData.Elements(), aData.Length(), mapping, dummy); parser.Append(aData.Elements(), aData.Length(), mapping, dummy);
@@ -182,7 +182,7 @@ class WebMContainerParser
nsTArray<WebMTimeDataOffset> mapping; nsTArray<WebMTimeDataOffset> mapping;
mapping.AppendElements(mOverlappedMapping); mapping.AppendElements(mOverlappedMapping);
mOverlappedMapping.Clear(); mOverlappedMapping.Clear();
ReentrantMonitor dummy MOZ_ANNOTATED("dummy"); ReentrantMonitor dummy("dummy");
mParser.Append(aData.Elements(), aData.Length(), mapping, dummy); mParser.Append(aData.Elements(), aData.Length(), mapping, dummy);
if (mResource) { if (mResource) {
mResource->AppendData(aData); mResource->AppendData(aData);

View File

@@ -83,7 +83,7 @@ class MediaSourceDemuxer : public MediaDataDemuxer,
MozPromiseHolder<InitPromise> mInitPromise; MozPromiseHolder<InitPromise> mInitPromise;
// Monitor to protect members below across multiple threads. // Monitor to protect members below across multiple threads.
mutable Monitor mMonitor MOZ_UNANNOTATED; mutable Monitor mMonitor;
RefPtr<TrackBuffersManager> mAudioTrack; RefPtr<TrackBuffersManager> mAudioTrack;
RefPtr<TrackBuffersManager> mVideoTrack; RefPtr<TrackBuffersManager> mVideoTrack;
MediaInfo mInfo; MediaInfo mInfo;
@@ -138,7 +138,7 @@ class MediaSourceTrackDemuxer
RefPtr<MediaSourceDemuxer> mParent; RefPtr<MediaSourceDemuxer> mParent;
TrackInfo::TrackType mType; TrackInfo::TrackType mType;
// Monitor protecting members below accessed from multiple threads. // Monitor protecting members below accessed from multiple threads.
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
media::TimeUnit mNextRandomAccessPoint; media::TimeUnit mNextRandomAccessPoint;
// Would be accessed in MFR's demuxer proxy task queue and TaskQueue, and // Would be accessed in MFR's demuxer proxy task queue and TaskQueue, and
// only be set on the TaskQueue. It can be accessed while on TaskQueue without // only be set on the TaskQueue. It can be accessed while on TaskQueue without

View File

@@ -514,7 +514,7 @@ class TrackBuffersManager final
Atomic<EvictionState> mEvictionState; Atomic<EvictionState> mEvictionState;
// Monitor to protect following objects accessed across multiple threads. // Monitor to protect following objects accessed across multiple threads.
mutable Mutex mMutex MOZ_UNANNOTATED; mutable Mutex mMutex;
// mTaskQueue is only ever written after construction on the task queue. // mTaskQueue is only ever written after construction on the task queue.
// As such, it can be accessed while on task queue without the need for the // As such, it can be accessed while on task queue without the need for the
// mutex. // mutex.

View File

@@ -29,7 +29,7 @@ class OggCodecStore {
nsClassHashtable<nsUint32HashKey, OggCodecState> mCodecStates; nsClassHashtable<nsUint32HashKey, OggCodecState> mCodecStates;
// Protects the |mCodecStates| and the |mKnownStreams| members. // Protects the |mCodecStates| and the |mKnownStreams| members.
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
}; };
} // namespace mozilla } // namespace mozilla

View File

@@ -57,7 +57,7 @@ class GlobalAllocPolicy {
private: private:
// Protect access to Instance(). // Protect access to Instance().
static StaticMutex sMutex MOZ_UNANNOTATED; static StaticMutex sMutex;
}; };
/** This the actual base implementation underneath all AllocPolicy objects and /** This the actual base implementation underneath all AllocPolicy objects and
@@ -86,7 +86,7 @@ class AllocPolicyImpl : public AllocPolicy {
void ResolvePromise(ReentrantMonitorAutoEnter& aProofOfLock); void ResolvePromise(ReentrantMonitorAutoEnter& aProofOfLock);
const int mMaxDecoderLimit; const int mMaxDecoderLimit;
ReentrantMonitor mMonitor MOZ_UNANNOTATED; ReentrantMonitor mMonitor;
// The number of decoders available for creation. // The number of decoders available for creation.
int mDecoderLimit; int mDecoderLimit;
// Requests to acquire tokens. // Requests to acquire tokens.

View File

@@ -148,7 +148,7 @@ class PDMInitializer final {
} }
static bool sHasInitializedPDMs; static bool sHasInitializedPDMs;
static StaticMutex sMonitor MOZ_UNANNOTATED; static StaticMutex sMonitor;
}; };
bool PDMInitializer::sHasInitializedPDMs = false; bool PDMInitializer::sHasInitializedPDMs = false;

View File

@@ -46,7 +46,7 @@ class SimpleMap {
} }
private: private:
Mutex mMutex MOZ_UNANNOTATED; // To protect mMap. Mutex mMutex; // To protect mMap.
AutoTArray<Element, 16> mMap; AutoTArray<Element, 16> mMap;
}; };

View File

@@ -51,7 +51,7 @@ class SamplesWaitingForKey {
~SamplesWaitingForKey(); ~SamplesWaitingForKey();
private: private:
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
RefPtr<CDMProxy> mProxy; RefPtr<CDMProxy> mProxy;
struct SampleEntry { struct SampleEntry {
RefPtr<MediaRawData> mSample; RefPtr<MediaRawData> mSample;

View File

@@ -112,7 +112,7 @@ class AppleVTDecoder : public MediaDataDecoder,
// not required and so input samples on mTaskQueue need not be processed. // not required and so input samples on mTaskQueue need not be processed.
Atomic<bool> mIsFlushing; Atomic<bool> mIsFlushing;
// Protects mReorderQueue and mPromise. // Protects mReorderQueue and mPromise.
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
ReorderQueue mReorderQueue; ReorderQueue mReorderQueue;
MozMonitoredPromiseHolder<DecodePromise> mPromise; MozMonitoredPromiseHolder<DecodePromise> mPromise;

View File

@@ -65,9 +65,8 @@ class FFmpegDataDecoder<LIBAV_VER>
AVCodecID mCodecID; // set in constructor AVCodecID mCodecID; // set in constructor
protected: protected:
static StaticMutex sMutex static StaticMutex sMutex; // used to provide critical-section locking
MOZ_UNANNOTATED; // used to provide critical-section locking // for calls into ffmpeg
// for calls into ffmpeg
const RefPtr<TaskQueue> mTaskQueue; // set in constructor const RefPtr<TaskQueue> mTaskQueue; // set in constructor
private: private:

View File

@@ -131,7 +131,7 @@ class VideoFramePool final {
private: private:
// Protect mDMABufSurfaces pool access // Protect mDMABufSurfaces pool access
Mutex mSurfaceLock MOZ_UNANNOTATED; Mutex mSurfaceLock;
nsTArray<RefPtr<VideoFrameSurfaceVAAPI>> mDMABufSurfaces; nsTArray<RefPtr<VideoFrameSurfaceVAAPI>> mDMABufSurfaces;
// We may fail to create texture over DMABuf memory due to driver bugs so // We may fail to create texture over DMABuf memory due to driver bugs so
// check that before we export first DMABuf video frame. // check that before we export first DMABuf video frame.

View File

@@ -941,7 +941,7 @@ D3D11DXVA2Manager::CopyToImage(IMFSample* aVideoSample,
if (!mutex && mDevice != DeviceManagerDx::Get()->GetCompositorDevice() && if (!mutex && mDevice != DeviceManagerDx::Get()->GetCompositorDevice() &&
mSyncObject) { mSyncObject) {
static StaticMutex sMutex MOZ_UNANNOTATED; static StaticMutex sMutex;
// Ensure that we only ever attempt to synchronise via the sync object // Ensure that we only ever attempt to synchronise via the sync object
// serially as when using the same D3D11 device for multiple video decoders // serially as when using the same D3D11 device for multiple video decoders
// it can lead to deadlocks. // it can lead to deadlocks.

View File

@@ -73,7 +73,7 @@ class DXVA2Manager {
const nsAString& aDriverVersionString); const nsAString& aDriverVersionString);
protected: protected:
Mutex mLock MOZ_UNANNOTATED; Mutex mLock;
DXVA2Manager(); DXVA2Manager();
bool IsUnsupportedResolution(const uint32_t& aWidth, const uint32_t& aHeight, bool IsUnsupportedResolution(const uint32_t& aWidth, const uint32_t& aHeight,

View File

@@ -242,7 +242,7 @@ already_AddRefed<MediaDataDecoder> WMFDecoderModule::CreateAudioDecoder(
template <const GUID& aGuid> template <const GUID& aGuid>
static bool CanCreateWMFDecoder() { static bool CanCreateWMFDecoder() {
static StaticMutex sMutex MOZ_UNANNOTATED; static StaticMutex sMutex;
StaticMutexAutoLock lock(sMutex); StaticMutexAutoLock lock(sMutex);
static Maybe<bool> result; static Maybe<bool> result;
if (result.isNothing()) { if (result.isNothing()) {

View File

@@ -231,7 +231,7 @@ class CamerasChild final : public PCamerasChild {
nsTArray<CapturerElement> mCallbacks; nsTArray<CapturerElement> mCallbacks;
// Protects the callback arrays // Protects the callback arrays
Mutex mCallbackMutex MOZ_UNANNOTATED; Mutex mCallbackMutex;
bool mIPCIsAlive; bool mIPCIsAlive;
@@ -243,11 +243,11 @@ class CamerasChild final : public PCamerasChild {
// request. The Notify on receiving the response will then unblock // request. The Notify on receiving the response will then unblock
// both waiters and one will be guaranteed to get the wrong result. // both waiters and one will be guaranteed to get the wrong result.
// Take this one before taking mReplyMonitor. // Take this one before taking mReplyMonitor.
Mutex mRequestMutex MOZ_UNANNOTATED; Mutex mRequestMutex;
// Hold to wait for an async response to our calls *and* until the // Hold to wait for an async response to our calls *and* until the
// user of LockAndDispatch<> has read the data out. This is done by // user of LockAndDispatch<> has read the data out. This is done by
// keeping the LockAndDispatch object alive. // keeping the LockAndDispatch object alive.
Monitor mReplyMonitor MOZ_UNANNOTATED; Monitor mReplyMonitor;
// Async response valid? // Async response valid?
bool mReceivedReply; bool mReceivedReply;
// Async responses data contents; // Async responses data contents;

View File

@@ -59,7 +59,7 @@ void MediaSystemResourceManager::Init() {
return; return;
} }
ReentrantMonitor barrier MOZ_UNANNOTATED("MediaSystemResourceManager::Init"); ReentrantMonitor barrier("MediaSystemResourceManager::Init");
ReentrantMonitorAutoEnter mainThreadAutoMon(barrier); ReentrantMonitorAutoEnter mainThreadAutoMon(barrier);
bool done = false; bool done = false;
@@ -191,8 +191,7 @@ bool MediaSystemResourceManager::AcquireSyncNoWait(
MOZ_ASSERT(aClient); MOZ_ASSERT(aClient);
MOZ_ASSERT(!InImageBridgeChildThread()); MOZ_ASSERT(!InImageBridgeChildThread());
ReentrantMonitor barrier MOZ_UNANNOTATED( ReentrantMonitor barrier("MediaSystemResourceManager::AcquireSyncNoWait");
"MediaSystemResourceManager::AcquireSyncNoWait");
ReentrantMonitorAutoEnter autoMon(barrier); ReentrantMonitorAutoEnter autoMon(barrier);
bool done = false; bool done = false;
{ {

View File

@@ -65,7 +65,7 @@ class MediaSystemResourceManager {
void HandleAcquireResult(uint32_t aId, bool aSuccess); void HandleAcquireResult(uint32_t aId, bool aSuccess);
ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; ReentrantMonitor mReentrantMonitor;
bool mShutDown; bool mShutDown;

View File

@@ -225,7 +225,7 @@ void Await(already_AddRefed<nsIEventTarget> aPool,
RejectFunction&& aRejectFunction) { RejectFunction&& aRejectFunction) {
RefPtr<TaskQueue> taskQueue = RefPtr<TaskQueue> taskQueue =
new TaskQueue(std::move(aPool), "MozPromiseAwait"); new TaskQueue(std::move(aPool), "MozPromiseAwait");
Monitor mon MOZ_UNANNOTATED(__func__); Monitor mon(__func__);
bool done = false; bool done = false;
aPromise->Then( aPromise->Then(
@@ -256,7 +256,7 @@ Await(already_AddRefed<nsIEventTarget> aPool,
RefPtr<MozPromise<ResolveValueType, RejectValueType, Excl>> aPromise) { RefPtr<MozPromise<ResolveValueType, RejectValueType, Excl>> aPromise) {
RefPtr<TaskQueue> taskQueue = RefPtr<TaskQueue> taskQueue =
new TaskQueue(std::move(aPool), "MozPromiseAwait"); new TaskQueue(std::move(aPool), "MozPromiseAwait");
Monitor mon MOZ_UNANNOTATED(__func__); Monitor mon(__func__);
bool done = false; bool done = false;
typename MozPromise<ResolveValueType, RejectValueType, typename MozPromise<ResolveValueType, RejectValueType,
@@ -400,7 +400,7 @@ class AsyncBlockers {
mPromise->Resolve(true, __func__); mPromise->Resolve(true, __func__);
mResolved = true; mResolved = true;
} }
Mutex mLock MOZ_UNANNOTATED; // protects mBlockers and mResolved. Mutex mLock; // protects mBlockers and mResolved.
std::map<void*, bool> mBlockers; std::map<void*, bool> mBlockers;
bool mResolved = false; bool mResolved = false;
const RefPtr<GenericPromise::Private> mPromise; const RefPtr<GenericPromise::Private> mPromise;

View File

@@ -12,7 +12,7 @@
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
static bool gRunLoopSet = false; static bool gRunLoopSet = false;
static mozilla::StaticMutex gMutex MOZ_UNANNOTATED; static mozilla::StaticMutex gMutex;
void mozilla_set_coreaudio_notification_runloop_if_needed() { void mozilla_set_coreaudio_notification_runloop_if_needed() {
mozilla::StaticMutexAutoLock lock(gMutex); mozilla::StaticMutexAutoLock lock(gMutex);

View File

@@ -50,7 +50,7 @@ class OpenSLESProvider {
void DestroyEngine(SLObjectItf* aObjectm); void DestroyEngine(SLObjectItf* aObjectm);
// Protect all our internal variables // Protect all our internal variables
mozilla::Mutex mLock MOZ_UNANNOTATED; mozilla::Mutex mLock;
SLObjectItf mSLEngine; SLObjectItf mSLEngine;
int mSLEngineUsers; int mSLEngineUsers;
bool mIsRealized; bool mIsRealized;

View File

@@ -169,7 +169,7 @@ class ShmemPool final {
&aRes.mShmem)); &aRes.mShmem));
} }
const PoolType mPoolType; const PoolType mPoolType;
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
size_t mPoolFree; size_t mPoolFree;
bool mErrorLogged; bool mErrorLogged;
#ifdef DEBUG #ifdef DEBUG

View File

@@ -61,7 +61,7 @@ class TabCapturer {
// Used to protect mCallback, since TabCapturer's lifetime might be // Used to protect mCallback, since TabCapturer's lifetime might be
// longer than mCallback's on stop/shutdown, and we may be waiting on a // longer than mCallback's on stop/shutdown, and we may be waiting on a
// tab to finish capturing on MainThread. // tab to finish capturing on MainThread.
Monitor mMonitor MOZ_UNANNOTATED; Monitor mMonitor;
webrtc::DesktopCapturer::Callback* mCallback = nullptr; webrtc::DesktopCapturer::Callback* mCallback = nullptr;
uint64_t mBrowserId = 0; uint64_t mBrowserId = 0;

View File

@@ -72,7 +72,7 @@ class AudioBufferMemoryTracker : public nsIMemoryReporter {
void Init(); void Init();
/* This protects all members of this class. */ /* This protects all members of this class. */
static StaticMutex sMutex MOZ_UNANNOTATED; static StaticMutex sMutex;
static StaticRefPtr<AudioBufferMemoryTracker> sSingleton; static StaticRefPtr<AudioBufferMemoryTracker> sSingleton;
nsTHashSet<const AudioBuffer*> mBuffers; nsTHashSet<const AudioBuffer*> mBuffers;
}; };

View File

@@ -80,7 +80,7 @@ class SharedBuffers final {
// Synchronizes access to mBufferList. Note that it's the responsibility // Synchronizes access to mBufferList. Note that it's the responsibility
// of the callers to perform the required locking, and we assert that every // of the callers to perform the required locking, and we assert that every
// time we access mBufferList. // time we access mBufferList.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// The list representing the queue. // The list representing the queue.
BufferList mBufferList; BufferList mBufferList;
}; };

View File

@@ -143,7 +143,7 @@ class HRTFDatabaseLoader {
nsAutoRef<HRTFDatabase> m_hrtfDatabase; nsAutoRef<HRTFDatabase> m_hrtfDatabase;
// Holding a m_threadLock is required when accessing m_databaseLoaderThread. // Holding a m_threadLock is required when accessing m_databaseLoaderThread.
mozilla::Mutex m_threadLock MOZ_UNANNOTATED; mozilla::Mutex m_threadLock;
PRThread* m_databaseLoaderThread; PRThread* m_databaseLoaderThread;
float m_databaseSampleRate; float m_databaseSampleRate;

View File

@@ -83,7 +83,7 @@ class ReverbConvolver {
// Background thread and synchronization // Background thread and synchronization
base::Thread m_backgroundThread; base::Thread m_backgroundThread;
mozilla::Monitor m_backgroundThreadMonitor MOZ_UNANNOTATED; mozilla::Monitor m_backgroundThreadMonitor;
bool m_useBackgroundThreads; bool m_useBackgroundThreads;
std::atomic<bool> m_wantsToExit; std::atomic<bool> m_wantsToExit;
std::atomic<bool> m_moreInputBuffered; std::atomic<bool> m_moreInputBuffered;

View File

@@ -298,7 +298,7 @@ class WebMBufferedState final {
MOZ_COUNTED_DTOR(WebMBufferedState) MOZ_COUNTED_DTOR(WebMBufferedState)
// Synchronizes access to the mTimeMapping array and mLastBlockOffset. // Synchronizes access to the mTimeMapping array and mLastBlockOffset.
ReentrantMonitor mReentrantMonitor MOZ_UNANNOTATED; ReentrantMonitor mReentrantMonitor;
// Sorted (by offset) map of data offsets to timecodes. Populated // Sorted (by offset) map of data offsets to timecodes. Populated
// on the main thread as data is received and parsed by WebMBufferedParsers. // on the main thread as data is received and parsed by WebMBufferedParsers.

View File

@@ -23,7 +23,7 @@ using AudioDeviceSet = CubebDeviceEnumerator::AudioDeviceSet;
/* static */ /* static */
static StaticRefPtr<CubebDeviceEnumerator> sInstance; static StaticRefPtr<CubebDeviceEnumerator> sInstance;
static StaticMutex sInstanceMutex MOZ_UNANNOTATED; static StaticMutex sInstanceMutex;
/* static */ /* static */
CubebDeviceEnumerator* CubebDeviceEnumerator::GetInstance() { CubebDeviceEnumerator* CubebDeviceEnumerator::GetInstance() {

View File

@@ -69,7 +69,7 @@ class CubebDeviceEnumerator final {
void AudioDeviceListChanged(Side aSide); void AudioDeviceListChanged(Side aSide);
RefPtr<const AudioDeviceSet> EnumerateAudioDevices(Side aSide); RefPtr<const AudioDeviceSet> EnumerateAudioDevices(Side aSide);
// Synchronize access to mInputDevices and mOutputDevices; // Synchronize access to mInputDevices and mOutputDevices;
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
RefPtr<const AudioDeviceSet> mInputDevices; RefPtr<const AudioDeviceSet> mInputDevices;
RefPtr<const AudioDeviceSet> mOutputDevices; RefPtr<const AudioDeviceSet> mOutputDevices;
// If mManual*Invalidation is true, then it is necessary to query the device // If mManual*Invalidation is true, then it is necessary to query the device

View File

@@ -152,7 +152,7 @@ class MediaEngineRemoteVideoSource : public MediaEngineSource,
// mMutex protects certain members on 3 threads: // mMutex protects certain members on 3 threads:
// MediaManager, Cameras IPC and MediaTrackGraph. // MediaManager, Cameras IPC and MediaTrackGraph.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// Current state of this source. // Current state of this source.
// Set under mMutex on the owning thread. Accessed under one of the two. // Set under mMutex on the owning thread. Accessed under one of the two.

View File

@@ -246,7 +246,7 @@ class WebrtcAudioConduit : public AudioSessionConduit,
// Accessed only on the Call thread. // Accessed only on the Call thread.
bool mDtmfEnabled; bool mDtmfEnabled;
mutable RWLock mLock MOZ_UNANNOTATED; mutable RWLock mLock;
// Call worker thread. All access to mCall->Call() happens here. // Call worker thread. All access to mCall->Call() happens here.
const RefPtr<AbstractThread> mCallThread; const RefPtr<AbstractThread> mCallThread;

View File

@@ -271,7 +271,7 @@ class WebrtcVideoConduit
bool RequiresNewSendStream(const VideoCodecConfig& newConfig) const; bool RequiresNewSendStream(const VideoCodecConfig& newConfig) const;
mutable mozilla::ReentrantMonitor mRendererMonitor MOZ_UNANNOTATED; mutable mozilla::ReentrantMonitor mRendererMonitor;
// Accessed on any thread under mRendererMonitor. // Accessed on any thread under mRendererMonitor.
RefPtr<mozilla::VideoRenderer> mRenderer; RefPtr<mozilla::VideoRenderer> mRenderer;
@@ -328,7 +328,7 @@ class WebrtcVideoConduit
// that will update the webrtc.org configuration. // that will update the webrtc.org configuration.
WatchManager<WebrtcVideoConduit> mWatchManager; WatchManager<WebrtcVideoConduit> mWatchManager;
mutable Mutex mMutex MOZ_UNANNOTATED; mutable Mutex mMutex;
// Decoder factory used by mRecvStream when it needs new decoders. This is // Decoder factory used by mRecvStream when it needs new decoders. This is
// not shared broader like some state in the WebrtcCallWrapper because it // not shared broader like some state in the WebrtcCallWrapper because it

View File

@@ -279,7 +279,7 @@ class WebrtcGmpVideoEncoder : public GMPVideoEncoderCallbackProxy,
uint32_t mMaxPayloadSize; uint32_t mMaxPayloadSize;
webrtc::CodecSpecificInfo mCodecSpecificInfo; webrtc::CodecSpecificInfo mCodecSpecificInfo;
// Protects mCallback // Protects mCallback
Mutex mCallbackMutex MOZ_UNANNOTATED; Mutex mCallbackMutex;
webrtc::EncodedImageCallback* mCallback; webrtc::EncodedImageCallback* mCallback;
Maybe<uint64_t> mCachedPluginId; Maybe<uint64_t> mCachedPluginId;
const std::string mPCHandle; const std::string mPCHandle;
@@ -430,7 +430,7 @@ class WebrtcGmpVideoDecoder : public GMPVideoDecoderCallbackProxy {
nsTArray<UniquePtr<GMPDecodeData>> mQueuedFrames; nsTArray<UniquePtr<GMPDecodeData>> mQueuedFrames;
GMPVideoHost* mHost; GMPVideoHost* mHost;
// Protects mCallback // Protects mCallback
Mutex mCallbackMutex MOZ_UNANNOTATED; Mutex mCallbackMutex;
webrtc::DecodedImageCallback* mCallback; webrtc::DecodedImageCallback* mCallback;
Maybe<uint64_t> mCachedPluginId; Maybe<uint64_t> mCachedPluginId;
Atomic<GMPErr, ReleaseAcquire> mDecoderStatus; Atomic<GMPErr, ReleaseAcquire> mDecoderStatus;

View File

@@ -57,7 +57,7 @@ class WebrtcMediaDataEncoder : public RefCountedWebrtcVideoEncoder {
const RefPtr<PEMFactory> mFactory; const RefPtr<PEMFactory> mFactory;
RefPtr<MediaDataEncoder> mEncoder; RefPtr<MediaDataEncoder> mEncoder;
Mutex mCallbackMutex MOZ_UNANNOTATED; // Protects mCallback and mError. Mutex mCallbackMutex; // Protects mCallback and mError.
webrtc::EncodedImageCallback* mCallback = nullptr; webrtc::EncodedImageCallback* mCallback = nullptr;
MediaResult mError = NS_OK; MediaResult mError = NS_OK;

View File

@@ -283,7 +283,7 @@ class NrUdpSocketIpc : public NrSocketIpc {
// STS thread executor // STS thread executor
void recv_callback_s(RefPtr<nr_udp_message> msg); void recv_callback_s(RefPtr<nr_udp_message> msg);
ReentrantMonitor monitor_ MOZ_UNANNOTATED; // protects err_and state_ ReentrantMonitor monitor_; // protects err_and state_
bool err_; bool err_;
NrSocketIpcState state_; NrSocketIpcState state_;

View File

@@ -1546,7 +1546,7 @@ class MediaPipelineReceiveVideo::PipelineListener
private: private:
RefPtr<layers::ImageContainer> mImageContainer; RefPtr<layers::ImageContainer> mImageContainer;
Mutex mMutex MOZ_UNANNOTATED; // Protects the below members. Mutex mMutex; // Protects the below members.
PrincipalHandle mPrincipalHandle; PrincipalHandle mPrincipalHandle;
// Set to true on the sts thread if privacy is requested when ALPN was // Set to true on the sts thread if privacy is requested when ALPN was
// negotiated. Set to false again when mPrincipalHandle is private. // negotiated. Set to false again when mPrincipalHandle is private.

View File

@@ -49,7 +49,7 @@ class MIDIMessageQueue {
// Array of messages to be sent. // Array of messages to be sent.
nsTArray<MIDIMessage> mMessageQueue; nsTArray<MIDIMessage> mMessageQueue;
// Mutex for coordinating cross thread array access. // Mutex for coordinating cross thread array access.
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
}; };
} // namespace dom } // namespace dom

View File

@@ -149,7 +149,7 @@ class MIDIPlatformService {
nsClassHashtable<nsStringHashKey, MIDIMessageQueue> mMessageQueues; nsClassHashtable<nsStringHashKey, MIDIMessageQueue> mMessageQueues;
// Mutex for managing access to message queue objects. // Mutex for managing access to message queue objects.
Mutex mMessageQueueMutex MOZ_UNANNOTATED; Mutex mMessageQueueMutex;
}; };
} // namespace mozilla::dom } // namespace mozilla::dom

View File

@@ -47,7 +47,7 @@ class midirMIDIPlatformService : public MIDIPlatformService {
// midir has its own internal threads and we can't execute jobs directly on // midir has its own internal threads and we can't execute jobs directly on
// them, instead we forward them to the background thread the service was // them, instead we forward them to the background thread the service was
// created in. // created in.
static StaticMutex gBackgroundThreadMutex MOZ_UNANNOTATED; static StaticMutex gBackgroundThreadMutex;
static nsCOMPtr<nsIThread> gBackgroundThread; static nsCOMPtr<nsIThread> gBackgroundThread;
}; };

View File

@@ -14,7 +14,7 @@
namespace mozilla::dom { namespace mozilla::dom {
static StaticRefPtr<PerformanceService> gPerformanceService; static StaticRefPtr<PerformanceService> gPerformanceService;
static StaticMutex gPerformanceServiceMutex MOZ_UNANNOTATED; static StaticMutex gPerformanceServiceMutex;
/* static */ /* static */
PerformanceService* PerformanceService::GetOrCreate() { PerformanceService* PerformanceService::GetOrCreate() {

View File

@@ -37,7 +37,7 @@ class PerformanceStorageWorker final : public PerformanceStorage {
PerformanceStorageWorker(); PerformanceStorageWorker();
~PerformanceStorageWorker(); ~PerformanceStorageWorker();
Mutex mMutex MOZ_UNANNOTATED; Mutex mMutex;
// Protected by mutex. // Protected by mutex.
// Created and released on worker-thread. Used also on main-thread. // Created and released on worker-thread. Used also on main-thread.

Some files were not shown because too many files have changed in this diff Show More