Loading netwerk/cache2/CacheEntry.cpp +12 −3 Original line number Diff line number Diff line Loading @@ -504,7 +504,12 @@ NS_IMETHODIMP CacheEntry::OnFileReady(nsresult aResult, bool aIsNew) { } NS_IMETHODIMP CacheEntry::OnFileDoomed(nsresult aResult) { if (mDoomCallback) { bool doomCallback = false; { mozilla::MutexAutoLock lock(mLock); doomCallback = bool(mDoomCallback); } if (doomCallback) { RefPtr<DoomCallbackRunnable> event = new DoomCallbackRunnable(this, aResult); NS_DispatchToMainThread(event); Loading Loading @@ -1760,8 +1765,12 @@ void CacheEntry::DoomFile() { } } // Always posts to the main thread. OnFileDoomed(rv); // mLock is already held; dispatch directly instead of calling // OnFileDoomed() which would deadlock re-acquiring it. if (mDoomCallback) { RefPtr<DoomCallbackRunnable> event = new DoomCallbackRunnable(this, rv); NS_DispatchToMainThread(event); } } void CacheEntry::RemoveForcedValidity() { Loading netwerk/cache2/CacheEntry.h +1 −1 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ class CacheEntry final : public nsIRunnable, ::mozilla::ThreadSafeAutoRefCnt mHandlesCount MOZ_GUARDED_BY(mLock); nsTArray<Callback> mCallbacks MOZ_GUARDED_BY(mLock); nsCOMPtr<nsICacheEntryDoomCallback> mDoomCallback; nsCOMPtr<nsICacheEntryDoomCallback> mDoomCallback MOZ_GUARDED_BY(mLock); // Set in CacheEntry::Load(), only - shouldn't need to be under lock // XXX FIX? is this correct? Loading Loading
netwerk/cache2/CacheEntry.cpp +12 −3 Original line number Diff line number Diff line Loading @@ -504,7 +504,12 @@ NS_IMETHODIMP CacheEntry::OnFileReady(nsresult aResult, bool aIsNew) { } NS_IMETHODIMP CacheEntry::OnFileDoomed(nsresult aResult) { if (mDoomCallback) { bool doomCallback = false; { mozilla::MutexAutoLock lock(mLock); doomCallback = bool(mDoomCallback); } if (doomCallback) { RefPtr<DoomCallbackRunnable> event = new DoomCallbackRunnable(this, aResult); NS_DispatchToMainThread(event); Loading Loading @@ -1760,8 +1765,12 @@ void CacheEntry::DoomFile() { } } // Always posts to the main thread. OnFileDoomed(rv); // mLock is already held; dispatch directly instead of calling // OnFileDoomed() which would deadlock re-acquiring it. if (mDoomCallback) { RefPtr<DoomCallbackRunnable> event = new DoomCallbackRunnable(this, rv); NS_DispatchToMainThread(event); } } void CacheEntry::RemoveForcedValidity() { Loading
netwerk/cache2/CacheEntry.h +1 −1 Original line number Diff line number Diff line Loading @@ -317,7 +317,7 @@ class CacheEntry final : public nsIRunnable, ::mozilla::ThreadSafeAutoRefCnt mHandlesCount MOZ_GUARDED_BY(mLock); nsTArray<Callback> mCallbacks MOZ_GUARDED_BY(mLock); nsCOMPtr<nsICacheEntryDoomCallback> mDoomCallback; nsCOMPtr<nsICacheEntryDoomCallback> mDoomCallback MOZ_GUARDED_BY(mLock); // Set in CacheEntry::Load(), only - shouldn't need to be under lock // XXX FIX? is this correct? Loading