зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1857687 - Disable thread safety analysis on a few problematic functions. r=nika,necko-reviewers,valentin
The functions return a reference to a value that is normally protected by a lock in an unlocked manner, but they do so on purpose. One of them can be annotated with the lock that is being held when it's called, though, so we do that. Differential Revision: https://phabricator.services.mozilla.com/D191707
This commit is contained in:
Родитель
d9a5545618
Коммит
ac55867690
|
@ -47,7 +47,10 @@ class ServiceWorkerRegistrarTest : public ServiceWorkerRegistrar {
|
|||
RegisterServiceWorkerInternal(aData);
|
||||
}
|
||||
|
||||
nsTArray<ServiceWorkerRegistrationData>& TestGetData() { return mData; }
|
||||
nsTArray<ServiceWorkerRegistrationData>& TestGetData()
|
||||
MOZ_NO_THREAD_SAFETY_ANALYSIS {
|
||||
return mData;
|
||||
}
|
||||
};
|
||||
|
||||
already_AddRefed<nsIFile> GetFile() {
|
||||
|
|
|
@ -81,7 +81,7 @@ class XMLHttpRequestStringBuffer final {
|
|||
private:
|
||||
~XMLHttpRequestStringBuffer() = default;
|
||||
|
||||
nsString& UnsafeData() { return mData; }
|
||||
nsString& UnsafeData() MOZ_NO_THREAD_SAFETY_ANALYSIS { return mData; }
|
||||
|
||||
Mutex mMutex;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class nsHttpRequestHead {
|
|||
// The following function is only used in HttpChannelParent to avoid
|
||||
// copying headers. If you use it be careful to do it only under
|
||||
// nsHttpRequestHead lock!!!
|
||||
const nsHttpHeaderArray& Headers() const;
|
||||
const nsHttpHeaderArray& Headers() const MOZ_REQUIRES(mRecursiveMutex);
|
||||
void Enter() const MOZ_CAPABILITY_ACQUIRE(mRecursiveMutex) {
|
||||
mRecursiveMutex.Lock();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче