Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE

This commit is contained in:
Noemi Erli 2022-03-16 18:32:51 +02:00
parent 4b033a5256
commit 2390d257e6
442 changed files with 548 additions and 587 deletions

View File

@ -115,7 +115,7 @@ class HandlerProvider final : public IGeckoBackChannel,
HRESULT* result);
Atomic<uint32_t> mRefCnt;
Mutex mMutex MOZ_UNANNOTATED; // Protects mSerializer
Mutex mMutex; // 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 MOZ_UNANNOTATED; // Protects mPayload
Mutex mPayloadMutex; // Protects mPayload
};
} // namespace a11y

View File

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

View File

@ -123,7 +123,7 @@ class TimelineConsumers : public nsIObserver {
LinkedList<MarkersStorage> mMarkersStores;
// Protects this class's data structures.
static StaticMutex sMutex MOZ_UNANNOTATED;
static StaticMutex sMutex;
};
} // 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
// thread. We must be sure that the releasing of resources doesn't trigger
// race conditions.
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
// Protected by mutex.
State mState;

View File

@ -1101,7 +1101,7 @@ class Manager::CachePutAllAction final : public DBAction {
nsTArray<nsID> mDeletedBodyIdList;
// accessed from any thread while mMutex locked
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
nsTArray<nsCOMPtr<nsISupports>> mCopyContextList;
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
// reading the same stream. Therefore, protect all access to these stream
// objects with a mutex.
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
CondVar mCondVar;
nsCOMPtr<nsIInputStream> mStream;
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*> sContextSet;

View File

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

View File

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

View File

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

View File

@ -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 MOZ_UNANNOTATED;
Mutex mMutex;
nsCOMPtr<nsIFile> mFile;

View File

@ -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 MOZ_UNANNOTATED;
static mozilla::StaticMutex sDataOwnerMutex;
static mozilla::StaticAutoPtr<mozilla::LinkedList<DataOwner> > sDataOwners;
static bool sMemoryReporterRegistered;

View File

@ -92,7 +92,7 @@ class MutableBlobStorage final {
[[nodiscard]] nsresult DispatchToIOThread(
already_AddRefed<nsIRunnable> aRunnable);
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
// All these variables are touched on the main thread only or in the
// 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
// multiple threads.
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
};
} // namespace mozilla

View File

@ -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 MOZ_UNANNOTATED;
Mutex mMutex;
const nsID mID;
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
// and mAsyncInputStream
Mutex mStateMachineMutex MOZ_UNANNOTATED;
Mutex mStateMachineMutex;
State mState;
// Stores the error code if stream is in error state
nsresult mError;

View File

@ -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 MOZ_UNANNOTATED;
static StaticMutex sMutex;
// All changes to gDataTable must happen on the main thread, while locking
// 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<GetFilesCallback>> mCallbacks;
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
// This variable is protected by mutex.
bool mCanceled;

View File

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

View File

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

View File

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

View File

@ -148,7 +148,7 @@ class HangMonitorChild : public PProcessHangMonitorChild,
static Atomic<HangMonitorChild*, SequentiallyConsistent> sInstance;
const RefPtr<ProcessHangMonitor> mHangMonitor;
Monitor mMonitor MOZ_UNANNOTATED;
Monitor mMonitor;
// 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 MOZ_UNANNOTATED;
Monitor mMonitor;
// 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 MOZ_UNANNOTATED;
Mutex mBrowserCrashDumpHashLock;
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),
// we must enforce that the reading does not happen simultaneously on
// different threads.
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
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.)
*/
class Connection::InitTemporaryOriginHelper final : public Runnable {
mozilla::Monitor mMonitor MOZ_UNANNOTATED;
mozilla::Monitor mMonitor;
const OriginMetadata mOriginMetadata;
nsString mOriginDirectoryPath;
nsresult mIOThreadResultCode;
@ -2614,7 +2614,7 @@ class QuotaClient final : public mozilla::dom::quota::Client {
static QuotaClient* sInstance;
Mutex mShadowDatabaseMutex MOZ_UNANNOTATED;
Mutex mShadowDatabaseMutex;
bool mShutdownRequested;
public:

View File

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

View File

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

View File

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

View File

@ -113,7 +113,7 @@ class InputStreamReader final : public nsIInputStreamCallback {
nsCOMPtr<nsIInputStream> mStream;
nsCOMPtr<nsIAsyncInputStream> mAsyncStream;
Monitor mMonitor MOZ_UNANNOTATED;
Monitor mMonitor;
};
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
// mDataMutex while holding mFileMutex! mFileMutex must be owned
// while accessing any of the following data fields or methods.
Mutex mFileMutex MOZ_UNANNOTATED;
Mutex mFileMutex;
// 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 MOZ_UNANNOTATED;
Mutex mDataMutex;
// 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.

View File

@ -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 MOZ_UNANNOTATED;
Mutex mLock;
// Seekable stream interface to file. This can be used from any
// thread.

View File

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

View File

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

View File

@ -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 MOZ_UNANNOTATED;
Monitor mMonitor;
// 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;

View File

@ -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 MOZ_UNANNOTATED;
mozilla::Monitor mMonitor;
// This must always be accessed when the monitor is held.
nsTArray<MediaCacheStream*> mStreams;
// The Blocks describing the cache entries.

View File

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

View File

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

View File

@ -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 MOZ_UNANNOTATED;
Mutex mMutex;
// The platform decoder.
RefPtr<MediaDataDecoder> mDecoder;
nsCString mDescription;

View File

@ -391,7 +391,7 @@ class MediaManager final : public nsIMediaManagerService,
RefPtr<MediaEngine> mBackend;
static StaticRefPtr<MediaManager> sSingleton;
static StaticMutex sSingletonMutex MOZ_UNANNOTATED;
static StaticMutex sSingletonMutex;
// Connect/Disconnect on media thread only
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>> mPushEvent;
MediaEventProducer<void> mFinishEvent;

View File

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

View File

@ -733,7 +733,7 @@ class SourceMediaTrack : public MediaTrack {
// This must be acquired *before* MediaTrackGraphImpl's lock, if they are
// held together.
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
// protected by mMutex
float mVolume = 1.0;
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
// the graph. Instead, communicate with the graph thread using provided
// mechanisms such as the ControlMessage queue.
Monitor mMonitor MOZ_UNANNOTATED;
Monitor mMonitor;
// Data guarded by mMonitor (must always be accessed with mMonitor held,
// regardless of the value of mLifecycleState).

View File

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

View File

@ -117,7 +117,7 @@ class VideoFrameContainer {
} mMainThreadState;
// mMutex protects all the fields below.
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
// 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

View File

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

View File

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

View File

@ -28,7 +28,7 @@ class MultiWriterQueueReaderLocking_Mutex {
void Unlock() { mMutex.Unlock(); };
private:
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
};
// 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
// happen.
struct DequeWrapperMW : DequeWrapperST {
mozilla::Mutex mMutex MOZ_UNANNOTATED;
mozilla::Mutex mMutex;
DequeWrapperMW() : mMutex("DequeWrapperMW/MT") {}

View File

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

View File

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

View File

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

View File

@ -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 MOZ_UNANNOTATED;
Monitor mInitPromiseMonitor;
MozMonitoredPromiseHolder<GenericPromise> mInitPromise;
bool mLoadPluginsFromDiskComplete;

View File

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

View File

@ -182,7 +182,7 @@ class MockCubebStream {
private:
// 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
// starting. Protected by FrozenStartMonitor.
bool mFrozenStart;

View File

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

View File

@ -21,7 +21,7 @@ static const int64_t gEndOffsets[] = {501, 772, 1244, 1380, 1543, 2015};
TEST(WebMBuffered, BasicTests)
{
ReentrantMonitor dummy MOZ_UNANNOTATED("dummy");
ReentrantMonitor dummy("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 MOZ_UNANNOTATED("dummy");
ReentrantMonitor dummy("dummy");
WebMBufferedParser parser(0);
nsTArray<uint8_t> webmData;
@ -82,7 +82,7 @@ TEST(WebMBuffered, RealData)
TEST(WebMBuffered, RealDataAppend)
{
ReentrantMonitor dummy MOZ_UNANNOTATED("dummy");
ReentrantMonitor dummy("dummy");
WebMBufferedParser parser(0);
nsTArray<WebMTimeDataOffset> mapping;

View File

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

View File

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

View File

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

View File

@ -116,7 +116,7 @@ class WebMContainerParser
WebMBufferedParser parser(0);
nsTArray<WebMTimeDataOffset> mapping;
ReentrantMonitor dummy MOZ_ANNOTATED("dummy");
ReentrantMonitor dummy("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 MOZ_ANNOTATED("dummy");
ReentrantMonitor dummy("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 MOZ_ANNOTATED("dummy");
ReentrantMonitor dummy("dummy");
mParser.Append(aData.Elements(), aData.Length(), mapping, dummy);
if (mResource) {
mResource->AppendData(aData);

View File

@ -83,7 +83,7 @@ class MediaSourceDemuxer : public MediaDataDemuxer,
MozPromiseHolder<InitPromise> mInitPromise;
// Monitor to protect members below across multiple threads.
mutable Monitor mMonitor MOZ_UNANNOTATED;
mutable Monitor mMonitor;
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 MOZ_UNANNOTATED;
Monitor mMonitor;
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

View File

@ -514,7 +514,7 @@ class TrackBuffersManager final
Atomic<EvictionState> mEvictionState;
// 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.
// As such, it can be accessed while on task queue without the need for the
// mutex.

View File

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

View File

@ -57,7 +57,7 @@ class GlobalAllocPolicy {
private:
// Protect access to Instance().
static StaticMutex sMutex MOZ_UNANNOTATED;
static StaticMutex sMutex;
};
/** 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 MOZ_UNANNOTATED;
ReentrantMonitor mMonitor;
// The number of decoders available for creation.
int mDecoderLimit;
// Requests to acquire tokens.

View File

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

View File

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

View File

@ -51,7 +51,7 @@ class SamplesWaitingForKey {
~SamplesWaitingForKey();
private:
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
RefPtr<CDMProxy> mProxy;
struct SampleEntry {
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.
Atomic<bool> mIsFlushing;
// Protects mReorderQueue and mPromise.
Monitor mMonitor MOZ_UNANNOTATED;
Monitor mMonitor;
ReorderQueue mReorderQueue;
MozMonitoredPromiseHolder<DecodePromise> mPromise;

View File

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

View File

@ -131,7 +131,7 @@ class VideoFramePool final {
private:
// Protect mDMABufSurfaces pool access
Mutex mSurfaceLock MOZ_UNANNOTATED;
Mutex mSurfaceLock;
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.

View File

@ -941,7 +941,7 @@ D3D11DXVA2Manager::CopyToImage(IMFSample* aVideoSample,
if (!mutex && mDevice != DeviceManagerDx::Get()->GetCompositorDevice() &&
mSyncObject) {
static StaticMutex sMutex MOZ_UNANNOTATED;
static StaticMutex sMutex;
// 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.

View File

@ -73,7 +73,7 @@ class DXVA2Manager {
const nsAString& aDriverVersionString);
protected:
Mutex mLock MOZ_UNANNOTATED;
Mutex mLock;
DXVA2Manager();
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>
static bool CanCreateWMFDecoder() {
static StaticMutex sMutex MOZ_UNANNOTATED;
static StaticMutex sMutex;
StaticMutexAutoLock lock(sMutex);
static Maybe<bool> result;
if (result.isNothing()) {

View File

@ -231,7 +231,7 @@ class CamerasChild final : public PCamerasChild {
nsTArray<CapturerElement> mCallbacks;
// Protects the callback arrays
Mutex mCallbackMutex MOZ_UNANNOTATED;
Mutex mCallbackMutex;
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 MOZ_UNANNOTATED;
Mutex mRequestMutex;
// 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 MOZ_UNANNOTATED;
Monitor mReplyMonitor;
// Async response valid?
bool mReceivedReply;
// Async responses data contents;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 MOZ_UNANNOTATED;
Monitor mMonitor;
webrtc::DesktopCapturer::Callback* mCallback = nullptr;
uint64_t mBrowserId = 0;

View File

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

View File

@ -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 MOZ_UNANNOTATED;
Mutex mMutex;
// The list representing the queue.
BufferList mBufferList;
};

View File

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

View File

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

View File

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

View File

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

View File

@ -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 MOZ_UNANNOTATED;
Mutex mMutex;
RefPtr<const AudioDeviceSet> mInputDevices;
RefPtr<const AudioDeviceSet> mOutputDevices;
// 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:
// MediaManager, Cameras IPC and MediaTrackGraph.
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
// Current state of this source.
// 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.
bool mDtmfEnabled;
mutable RWLock mLock MOZ_UNANNOTATED;
mutable RWLock mLock;
// Call worker thread. All access to mCall->Call() happens here.
const RefPtr<AbstractThread> mCallThread;

View File

@ -271,7 +271,7 @@ class WebrtcVideoConduit
bool RequiresNewSendStream(const VideoCodecConfig& newConfig) const;
mutable mozilla::ReentrantMonitor mRendererMonitor MOZ_UNANNOTATED;
mutable mozilla::ReentrantMonitor mRendererMonitor;
// 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 MOZ_UNANNOTATED;
mutable Mutex mMutex;
// Decoder factory used by mRecvStream when it needs new decoders. This is
// not shared broader like some state in the WebrtcCallWrapper because it

View File

@ -279,7 +279,7 @@ class WebrtcGmpVideoEncoder : public GMPVideoEncoderCallbackProxy,
uint32_t mMaxPayloadSize;
webrtc::CodecSpecificInfo mCodecSpecificInfo;
// Protects mCallback
Mutex mCallbackMutex MOZ_UNANNOTATED;
Mutex mCallbackMutex;
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 MOZ_UNANNOTATED;
Mutex mCallbackMutex;
webrtc::DecodedImageCallback* mCallback;
Maybe<uint64_t> mCachedPluginId;
Atomic<GMPErr, ReleaseAcquire> mDecoderStatus;

View File

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

View File

@ -283,7 +283,7 @@ class NrUdpSocketIpc : public NrSocketIpc {
// STS thread executor
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_;
NrSocketIpcState state_;

View File

@ -1546,7 +1546,7 @@ class MediaPipelineReceiveVideo::PipelineListener
private:
RefPtr<layers::ImageContainer> mImageContainer;
Mutex mMutex MOZ_UNANNOTATED; // Protects the below members.
Mutex mMutex; // 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.

View File

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

View File

@ -149,7 +149,7 @@ class MIDIPlatformService {
nsClassHashtable<nsStringHashKey, MIDIMessageQueue> mMessageQueues;
// Mutex for managing access to message queue objects.
Mutex mMessageQueueMutex MOZ_UNANNOTATED;
Mutex mMessageQueueMutex;
};
} // 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
// them, instead we forward them to the background thread the service was
// created in.
static StaticMutex gBackgroundThreadMutex MOZ_UNANNOTATED;
static StaticMutex gBackgroundThreadMutex;
static nsCOMPtr<nsIThread> gBackgroundThread;
};

View File

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

View File

@ -37,7 +37,7 @@ class PerformanceStorageWorker final : public PerformanceStorage {
PerformanceStorageWorker();
~PerformanceStorageWorker();
Mutex mMutex MOZ_UNANNOTATED;
Mutex mMutex;
// Protected by mutex.
// 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