Bug 1289164 - Make about:cache not modify cache entry state on display. r=michal
authorHonza Bambas <honzab.moz@firemni.cz>
Tue, 09 Aug 2016 11:23:00 -0400
changeset 310999 fa4d738b6664ed3f4ffde80a8538d3994bead884
parent 310998 a66acdcf56461126cc014454f9e61330b5f139ac
child 311000 2e78bdf4f0225f46dab2c362f7621cd06d7c5203
push id20386
push userryanvm@gmail.com
push dateThu, 25 Aug 2016 12:13:22 +0000
treeherderfx-team@9467a563a01b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs1289164
milestone51.0a1
Bug 1289164 - Make about:cache not modify cache entry state on display. r=michal
netwerk/cache2/CacheStorageService.cpp
netwerk/protocol/about/nsAboutCacheEntry.cpp
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -459,17 +459,17 @@ private:
           if (CacheIOThread::YieldAndRerun())
             return NS_OK;
 
           SHA1Sum::Hash hash;
           rv = mIter->GetNextHash(&hash);
           if (NS_FAILED(rv))
             break; // done (or error?)
 
-          // This synchronously invokes onCacheEntryInfo on this class where we
+          // This synchronously invokes OnEntryInfo on this class where we
           // redispatch to the main thread for the consumer callback.
           CacheFileIOManager::GetEntryInfo(&hash, this);
         }
 
         // Invoke onCacheEntryVisitCompleted on the main thread
         NS_DispatchToMainThread(this);
       }
     } else if (NS_IsMainThread()) {
--- a/netwerk/protocol/about/nsAboutCacheEntry.cpp
+++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp
@@ -203,17 +203,19 @@ nsAboutCacheEntry::Channel::OpenCacheEnt
     nsresult rv;
 
     nsCOMPtr<nsICacheStorage> storage;
     rv = nsAboutCache::GetStorage(mStorageName, mLoadInfo, getter_AddRefs(storage));
     if (NS_FAILED(rv)) return rv;
 
     // Invokes OnCacheEntryAvailable()
     rv = storage->AsyncOpenURI(mCacheURI, mEnhanceId,
-                               nsICacheStorage::OPEN_READONLY, this);
+                               nsICacheStorage::OPEN_READONLY |
+                               nsICacheStorage::OPEN_SECRETLY,
+                               this);
     if (NS_FAILED(rv)) return rv;
 
     return NS_OK;
 }
 
 nsresult
 nsAboutCacheEntry::Channel::ParseURI(nsIURI *uri,
                                      nsACString &storageName,