Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D140849
This commit is contained in:
Randell Jesup 2022-03-16 16:16:14 +00:00
Родитель 92dc02999c
Коммит 4b033a5256
442 изменённых файлов: 587 добавлений и 548 удалений

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

@ -115,7 +115,7 @@ class HandlerProvider final : public IGeckoBackChannel,
HRESULT* result);
Atomic<uint32_t> mRefCnt;
Mutex mMutex; // Protects mSerializer
Mutex mMutex MOZ_UNANNOTATED; // Protects mSerializer
const IID mTargetUnkIid;
mscom::InterceptorTargetPtr<IUnknown>
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
// fetch operation. See prebuildPayload().
IA2PayloadPtr mPayload;
Mutex mPayloadMutex; // Protects mPayload
Mutex mPayloadMutex MOZ_UNANNOTATED; // Protects mPayload
};
} // namespace a11y

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

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

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

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

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

@ -227,7 +227,7 @@ class BodyStream final : public nsIInputStreamCallback,
// 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
// race conditions.
Mutex mMutex;
Mutex mMutex MOZ_UNANNOTATED;
// Protected by mutex.
State mState;

2
dom/cache/Manager.cpp поставляемый
Просмотреть файл

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

2
dom/cache/ReadStream.cpp поставляемый
Просмотреть файл

@ -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
// reading the same stream. Therefore, protect all access to these stream
// objects with a mutex.
Mutex mMutex;
Mutex mMutex MOZ_UNANNOTATED;
CondVar mCondVar;
nsCOMPtr<nsIInputStream> mStream;
nsCOMPtr<nsIInputStream> mSnappyStream;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -186,7 +186,7 @@ class ChannelMediaResource
void Revoke();
private:
Mutex mMutex;
Mutex mMutex MOZ_UNANNOTATED;
// 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
// with the lock.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -392,7 +392,7 @@ class MediaFormatReader final
// as those can be read outside the TaskQueue.
// 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.
Mutex mMutex;
Mutex mMutex MOZ_UNANNOTATED;
// The platform decoder.
RefPtr<MediaDataDecoder> mDecoder;
nsCString mDescription;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -83,7 +83,7 @@ class MediaSourceDemuxer : public MediaDataDemuxer,
MozPromiseHolder<InitPromise> mInitPromise;
// Monitor to protect members below across multiple threads.
mutable Monitor mMonitor;
mutable Monitor mMonitor MOZ_UNANNOTATED;
RefPtr<TrackBuffersManager> mAudioTrack;
RefPtr<TrackBuffersManager> mVideoTrack;
MediaInfo mInfo;
@ -138,7 +138,7 @@ class MediaSourceTrackDemuxer
RefPtr<MediaSourceDemuxer> mParent;
TrackInfo::TrackType mType;
// Monitor protecting members below accessed from multiple threads.
Monitor mMonitor;
Monitor mMonitor MOZ_UNANNOTATED;
media::TimeUnit mNextRandomAccessPoint;
// 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

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

@ -514,7 +514,7 @@ class TrackBuffersManager final
Atomic<EvictionState> mEvictionState;
// Monitor to protect following objects accessed across multiple threads.
mutable Mutex mMutex;
mutable Mutex mMutex MOZ_UNANNOTATED;
// 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
// mutex.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -231,7 +231,7 @@ class CamerasChild final : public PCamerasChild {
nsTArray<CapturerElement> mCallbacks;
// Protects the callback arrays
Mutex mCallbackMutex;
Mutex mCallbackMutex MOZ_UNANNOTATED;
bool mIPCIsAlive;
@ -243,11 +243,11 @@ class CamerasChild final : public PCamerasChild {
// request. The Notify on receiving the response will then unblock
// both waiters and one will be guaranteed to get the wrong result.
// Take this one before taking mReplyMonitor.
Mutex mRequestMutex;
Mutex mRequestMutex MOZ_UNANNOTATED;
// 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
// keeping the LockAndDispatch object alive.
Monitor mReplyMonitor;
Monitor mReplyMonitor MOZ_UNANNOTATED;
// Async response valid?
bool mReceivedReply;
// Async responses data contents;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -47,7 +47,7 @@ class midirMIDIPlatformService : public MIDIPlatformService {
// 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
// created in.
static StaticMutex gBackgroundThreadMutex;
static StaticMutex gBackgroundThreadMutex MOZ_UNANNOTATED;
static nsCOMPtr<nsIThread> gBackgroundThread;
};

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

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

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

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

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше