зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1276930 - Bypass HTTP cache data read right after shutdown, r=michal
--HG-- extra : rebase_source : c0f568a3642c74eaad7f901c52f6dd67c6281217
This commit is contained in:
Родитель
76f6cc7739
Коммит
1998cc0732
|
@ -1818,6 +1818,11 @@ CacheFileIOManager::Read(CacheFileHandle *aHandle, int64_t aOffset,
|
|||
LOG(("CacheFileIOManager::Read() [handle=%p, offset=%lld, count=%d, "
|
||||
"listener=%p]", aHandle, aOffset, aCount, aCallback));
|
||||
|
||||
if (CacheObserver::ShuttingDown()) {
|
||||
LOG((" no reads after shutdown"));
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
nsresult rv;
|
||||
RefPtr<CacheFileIOManager> ioMan = gInstance;
|
||||
|
||||
|
@ -1844,6 +1849,11 @@ CacheFileIOManager::ReadInternal(CacheFileHandle *aHandle, int64_t aOffset,
|
|||
|
||||
nsresult rv;
|
||||
|
||||
if (CacheObserver::ShuttingDown()) {
|
||||
LOG((" no reads after shutdown"));
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!aHandle->mFileExists) {
|
||||
NS_WARNING("Trying to read from non-existent file");
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
|
|
@ -97,7 +97,7 @@ bool CacheObserver::sHashStatsReported = kDefaultHashStatsReported;
|
|||
static uint32_t const kDefaultMaxShutdownIOLag = 2; // seconds
|
||||
Atomic<uint32_t, Relaxed> CacheObserver::sMaxShutdownIOLag(kDefaultMaxShutdownIOLag);
|
||||
|
||||
Atomic<PRIntervalTime, Relaxed> CacheObserver::sShutdownDemandedTime(PR_INTERVAL_NO_TIMEOUT);
|
||||
Atomic<PRIntervalTime> CacheObserver::sShutdownDemandedTime(PR_INTERVAL_NO_TIMEOUT);
|
||||
|
||||
NS_IMPL_ISUPPORTS(CacheObserver,
|
||||
nsIObserver,
|
||||
|
|
|
@ -107,7 +107,7 @@ private:
|
|||
static bool sCacheFSReported;
|
||||
static bool sHashStatsReported;
|
||||
static Atomic<uint32_t, Relaxed> sMaxShutdownIOLag;
|
||||
static Atomic<PRIntervalTime, Relaxed> sShutdownDemandedTime;
|
||||
static Atomic<PRIntervalTime> sShutdownDemandedTime;
|
||||
|
||||
// Non static properties, accessible via sSelf
|
||||
nsCOMPtr<nsIFile> mCacheParentDirectoryOverride;
|
||||
|
|
Загрузка…
Ссылка в новой задаче