Bug 1396307 - Set mCacheAsyncOpenCalled back to flase when AsyncOpenURI fails r=michal

MozReview-Commit-ID: VnwI3ERHVt

--HG--
extra : rebase_source : b0dd35d8dc246edef20c4d6cf220013131366b1e
This commit is contained in:
Valentin Gosu 2017-09-14 22:21:49 +02:00
Родитель ec3cf55bec
Коммит 617da36cf0
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -3979,6 +3979,10 @@ nsHttpChannel::OpenCacheEntry(bool isHttps)
mRaceCacheWithNetwork = sRCWNEnabled;
}
rv = cacheStorage->AsyncOpenURI(openURI, extension, cacheEntryOpenFlags, this);
if (NS_FAILED(rv)) {
// Drop the flag since the cache open failed
mCacheAsyncOpenCalled = false;
}
} else {
// We pass `this` explicitly as a parameter due to the raw pointer
// to refcounted object in lambda analysis.
@ -3988,7 +3992,10 @@ nsHttpChannel::OpenCacheEntry(bool isHttps)
if (self->mNetworkTriggered) {
self->mRaceCacheWithNetwork = true;
}
cacheStorage->AsyncOpenURI(openURI, extension, cacheEntryOpenFlags, self);
nsresult rv = cacheStorage->AsyncOpenURI(openURI, extension, cacheEntryOpenFlags, self);
if (NS_FAILED(rv)) {
self->mCacheAsyncOpenCalled = false;
}
};
mCacheOpenTimer = do_CreateInstance(NS_TIMER_CONTRACTID);