зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1746316: Lock when collecting SizeOfIncludingThis r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D133984
This commit is contained in:
Родитель
bb03547b02
Коммит
69eed5881c
|
@ -116,8 +116,8 @@ already_AddRefed<DataStorage> DataStorage::GetFromRawFileName(
|
|||
aFilename, [&] { return RefPtr{new DataStorage(aFilename)}; }));
|
||||
}
|
||||
|
||||
size_t DataStorage::SizeOfIncludingThis(
|
||||
mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||
size_t DataStorage::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) {
|
||||
MutexAutoLock lock(mMutex);
|
||||
size_t sizeOfExcludingThis =
|
||||
mPersistentDataTable.ShallowSizeOfExcludingThis(aMallocSizeOf) +
|
||||
mTemporaryDataTable.ShallowSizeOfExcludingThis(aMallocSizeOf) +
|
||||
|
|
|
@ -131,7 +131,7 @@ class DataStorage : public nsIObserver {
|
|||
// Read all of the data items.
|
||||
void GetAll(nsTArray<DataStorageItem>* aItems);
|
||||
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
||||
|
||||
// Return true if this data storage is ready to be used.
|
||||
bool IsReady();
|
||||
|
|
|
@ -151,6 +151,7 @@ class nsCertOverrideService final : public nsICertOverrideService,
|
|||
const nsACString& dbKey,
|
||||
const mozilla::MutexAutoLock& aProofOfLock);
|
||||
|
||||
// Set in constructor only
|
||||
RefPtr<mozilla::TaskQueue> mWriterTaskQueue;
|
||||
|
||||
// Only accessed on the main thread
|
||||
|
|
|
@ -39,6 +39,7 @@ nsProtectedAuthThread::nsProtectedAuthThread()
|
|||
nsProtectedAuthThread::~nsProtectedAuthThread() = default;
|
||||
|
||||
NS_IMETHODIMP nsProtectedAuthThread::Login(nsIObserver* aObserver) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
NS_ENSURE_ARG(aObserver);
|
||||
|
||||
if (!mSlot)
|
||||
|
@ -128,6 +129,7 @@ void nsProtectedAuthThread::Run(void) {
|
|||
}
|
||||
|
||||
void nsProtectedAuthThread::Join() {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (!mThreadHandle) return;
|
||||
|
||||
PR_JoinThread(mThreadHandle);
|
||||
|
|
|
@ -23,7 +23,7 @@ class nsProtectedAuthThread : public nsIProtectedAuthThread {
|
|||
bool mIAmRunning;
|
||||
bool mLoginReady;
|
||||
|
||||
PRThread* mThreadHandle;
|
||||
PRThread* mThreadHandle; // MainThread only
|
||||
|
||||
// Slot to do authentication on
|
||||
PK11SlotInfo* mSlot;
|
||||
|
|
Загрузка…
Ссылка в новой задаче