From e03354c9e31be28a54d744243ac6c639018838c7 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Thu, 11 Sep 2014 13:07:41 +0200 Subject: [PATCH] Backed out changeset 25c721fd5dc6 (bug 1029782) for XPCshell bustage on a CLOSED TREE --- netwerk/cache2/CacheEntry.cpp | 15 ++------ netwerk/cache2/CacheEntry.h | 3 +- netwerk/cache2/nsICacheStorage.idl | 5 --- .../unit/test_cache2-28a-OPEN_SECRETLY.js | 34 ------------------- netwerk/test/unit/xpcshell.ini | 1 - 5 files changed, 4 insertions(+), 54 deletions(-) delete mode 100644 netwerk/test/unit/test_cache2-28a-OPEN_SECRETLY.js diff --git a/netwerk/cache2/CacheEntry.cpp b/netwerk/cache2/CacheEntry.cpp index a8aec185c03..9aacd15b1fa 100644 --- a/netwerk/cache2/CacheEntry.cpp +++ b/netwerk/cache2/CacheEntry.cpp @@ -76,8 +76,7 @@ CacheEntryHandle::~CacheEntryHandle() CacheEntry::Callback::Callback(CacheEntry* aEntry, nsICacheEntryOpenCallback *aCallback, - bool aReadOnly, bool aCheckOnAnyThread, - bool aSecret) + bool aReadOnly, bool aCheckOnAnyThread) : mEntry(aEntry) , mCallback(aCallback) , mTargetThread(do_GetCurrentThread()) @@ -85,7 +84,6 @@ CacheEntry::Callback::Callback(CacheEntry* aEntry, , mCheckOnAnyThread(aCheckOnAnyThread) , mRecheckAfterWrite(false) , mNotWanted(false) -, mSecret(aSecret) { MOZ_COUNT_CTOR(CacheEntry::Callback); @@ -103,7 +101,6 @@ CacheEntry::Callback::Callback(CacheEntry::Callback const &aThat) , mCheckOnAnyThread(aThat.mCheckOnAnyThread) , mRecheckAfterWrite(aThat.mRecheckAfterWrite) , mNotWanted(aThat.mNotWanted) -, mSecret(aThat.mSecret) { MOZ_COUNT_CTOR(CacheEntry::Callback); @@ -272,12 +269,11 @@ void CacheEntry::AsyncOpen(nsICacheEntryOpenCallback* aCallback, uint32_t aFlags bool truncate = aFlags & nsICacheStorage::OPEN_TRUNCATE; bool priority = aFlags & nsICacheStorage::OPEN_PRIORITY; bool multithread = aFlags & nsICacheStorage::CHECK_MULTITHREADED; - bool secret = aFlags & nsICacheStorage::OPEN_SECRETLY; MOZ_ASSERT(!readonly || !truncate, "Bad flags combination"); MOZ_ASSERT(!(truncate && mState > LOADING), "Must not call truncate on already loaded entry"); - Callback callback(this, aCallback, readonly, multithread, secret); + Callback callback(this, aCallback, readonly, multithread); if (!Open(callback, truncate, priority, bypassIfBusy)) { // We get here when the callback wants to bypass cache when it's busy. @@ -763,7 +759,7 @@ void CacheEntry::InvokeAvailableCallback(Callback const & aCallback) return; } - if (NS_SUCCEEDED(mFileStatus) && !aCallback.mSecret) { + if (NS_SUCCEEDED(mFileStatus)) { // Let the last-fetched and fetch-count properties be updated. mFile->OnFetched(); } @@ -777,8 +773,6 @@ void CacheEntry::InvokeAvailableCallback(Callback const & aCallback) if (state == READY) { LOG((" ready/has-meta, notifying OCEA with entry and NS_OK")); - - if (!aCallback.mSecret) { mozilla::MutexAutoLock lock(mLock); BackgroundOp(Ops::FRECENCYUPDATE); @@ -828,10 +822,7 @@ CacheEntryHandle* CacheEntry::NewWriteHandle() { mozilla::MutexAutoLock lock(mLock); - // Ignore the OPEN_SECRETLY flag on purpose here, which should actually be - // used only along with OPEN_READONLY, but there is no need to enforce that. BackgroundOp(Ops::FRECENCYUPDATE); - return (mWriter = NewHandle()); } diff --git a/netwerk/cache2/CacheEntry.h b/netwerk/cache2/CacheEntry.h index 2c9e6ca8f5c..f24d0eec259 100644 --- a/netwerk/cache2/CacheEntry.h +++ b/netwerk/cache2/CacheEntry.h @@ -137,7 +137,7 @@ private: public: Callback(CacheEntry* aEntry, nsICacheEntryOpenCallback *aCallback, - bool aReadOnly, bool aCheckOnAnyThread, bool aSecret); + bool aReadOnly, bool aCheckOnAnyThread); Callback(Callback const &aThat); ~Callback(); @@ -155,7 +155,6 @@ private: bool mCheckOnAnyThread : 1; bool mRecheckAfterWrite : 1; bool mNotWanted : 1; - bool mSecret : 1; nsresult OnCheckThread(bool *aOnCheckThread) const; nsresult OnAvailThread(bool *aOnAvailThread) const; diff --git a/netwerk/cache2/nsICacheStorage.idl b/netwerk/cache2/nsICacheStorage.idl index 49812a590da..991d050a61b 100644 --- a/netwerk/cache2/nsICacheStorage.idl +++ b/netwerk/cache2/nsICacheStorage.idl @@ -51,11 +51,6 @@ interface nsICacheStorage : nsISupports */ const uint32_t CHECK_MULTITHREADED = 1 << 4; - /** - * Don't automatically update any 'last used' metadata of the entry. - */ - const uint32_t OPEN_SECRETLY = 1 << 5; - /** * Asynchronously opens a cache entry for the specified URI. * Result is fetched asynchronously via the callback. diff --git a/netwerk/test/unit/test_cache2-28a-OPEN_SECRETLY.js b/netwerk/test/unit/test_cache2-28a-OPEN_SECRETLY.js deleted file mode 100644 index fdc66e10fb9..00000000000 --- a/netwerk/test/unit/test_cache2-28a-OPEN_SECRETLY.js +++ /dev/null @@ -1,34 +0,0 @@ -function run_test() -{ - do_get_profile(); - function NowSeconds() { - return parseInt((new Date()).getTime() / 1000); - } - function do_check_time(a, b) { - do_check_true(Math.abs(a - b) < 0.5); - } - - asyncOpenCacheEntry("http://t/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null, - new OpenCallback(NEW, "m", "d", function(entry) { - - var now1 = NowSeconds(); - do_check_eq(entry.fetchCount, 1); - do_check_time(entry.lastFetched, now1); - do_check_time(entry.lastModified, now1); - - do_timeout(2000, () => { - asyncOpenCacheEntry("http://t/", "disk", Ci.nsICacheStorage.OPEN_SECRETLY, null, - new OpenCallback(NORMAL, "m", "d", function(entry) { - do_check_eq(entry.fetchCount, 1); - do_check_time(entry.lastFetched, now1); - do_check_time(entry.lastModified, now1); - - finish_cache2_test(); - }) - ); - }) - }) - ); - - do_test_pending(); -} diff --git a/netwerk/test/unit/xpcshell.ini b/netwerk/test/unit/xpcshell.ini index 1af1001eb5b..00cfec60af4 100644 --- a/netwerk/test/unit/xpcshell.ini +++ b/netwerk/test/unit/xpcshell.ini @@ -60,7 +60,6 @@ support-files = skip-if = os == "android" [test_cache2-27-force-valid-for.js] [test_cache2-28-last-access-attrs.js] -[test_cache2-28a-OPEN_SECRETLY.js] [test_304_responses.js] [test_cacheForOfflineUse_no-store.js] [test_307_redirect.js]