Backing out 6c5c6cbad330 (bug 1032992) for Adnroid failures - GC doesn't work there as on other platforms..., r=backout
authorHonza Bambas <honzab.moz@firemni.cz>
Wed, 02 Jul 2014 19:53:00 +0200
changeset 191925 b60afce726d19fb20e04874b7dce3cd217e165c3
parent 191924 2d734c2008b1ed3149ffd7a71bc65858d6242b82
child 191926 ffddc07896d7bc6b6627cf9348383bc57ca54e0d
child 191974 ff731ea82e4d82a028eb01c8862f0c8fa599180e
push id45695
push userhonzab.moz@firemni.cz
push dateWed, 02 Jul 2014 17:53:59 +0000
treeherdermozilla-inbound@b60afce726d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1032992
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backing out 6c5c6cbad330 (bug 1032992) for Adnroid failures - GC doesn't work there as on other platforms..., r=backout
netwerk/cache2/CacheEntry.cpp
netwerk/test/unit/head_cache2.js
netwerk/test/unit/test_cache2-26-no-outputstream-open.js
netwerk/test/unit/xpcshell.ini
--- a/netwerk/cache2/CacheEntry.cpp
+++ b/netwerk/cache2/CacheEntry.cpp
@@ -844,31 +844,16 @@ void CacheEntry::OnHandleClosed(CacheEnt
       LOG(("  reverting to state EMPTY - write failed"));
       mState = EMPTY;
     }
     else if (mState == REVALIDATING) {
       LOG(("  reverting to state READY - reval failed"));
       mState = READY;
     }
 
-    if (mState == READY && !mHasData) {
-      // We may get to this state when following steps happen:
-      // 1. a new entry is given to a consumer
-      // 2. the consumer calls MetaDataReady(), we transit to READY
-      // 3. abandons the entry w/o opening the output stream, mHasData left false
-      //
-      // In this case any following consumer will get a ready entry (with metadata)
-      // but in state like the entry data write was still happening (was in progress)
-      // and will indefinitely wait for the entry data or even the entry itself when
-      // RECHECK_AFTER_WRITE is returned from onCacheEntryCheck.
-      LOG(("  we are in READY state, pretend we have data regardless it"
-            " has actully been never touched"));
-      mHasData = true;
-    }
-
     InvokeCallbacks();
   }
 
   if (outputStream) {
     LOG(("  abandoning phantom output stream"));
     outputStream->Close();
   }
 }
--- a/netwerk/test/unit/head_cache2.js
+++ b/netwerk/test/unit/head_cache2.js
@@ -40,18 +40,16 @@ const METAONLY =        1 << 9;
 // Do recreation of an existing cache entry
 const RECREATE =        1 << 10;
 // Do not give me the entry
 const NOTWANTED =       1 << 11;
 // Tell the cache to wait for the entry to be completely written first
 const COMPLETE =        1 << 12;
 // Don't write meta/data and don't set valid in the callback, consumer will do it manually
 const DONTFILL =        1 << 13;
-// Used in combination with METAONLY, don't call setValid() on the entry after metadata has been set
-const DONTSETVALID =    1 << 14;
 
 var log_c2 = true;
 function LOG_C2(o, m)
 {
   if (!log_c2) return;
   if (!m)
     dump("TEST-INFO | CACHE2: " + o + "\n");
   else
@@ -189,23 +187,18 @@ OpenCallback.prototype =
       }
 
       var self = this;
       do_execute_soon(function() { // emulate network latency
         entry.setMetaDataElement("meto", self.workingMetadata);
         entry.metaDataReady();
         if (self.behavior & METAONLY) {
           // Since forcing GC/CC doesn't trigger OnWriterClosed, we have to set the entry valid manually :(
-          if (!(self.behavior & DONTSETVALID))
-            entry.setValid();
-
+          entry.setValid();
           entry.close();
-          if (self.behavior & WAITFORWRITE)
-            self.goon(entry);
-
           return;
         }
         do_execute_soon(function() { // emulate more network latency
           if (self.behavior & DOOMED) {
             try {
               var os = entry.openOutputStream(0);
               do_check_true(false);
             } catch (ex) {
deleted file mode 100644
--- a/netwerk/test/unit/test_cache2-26-no-outputstream-open.js
+++ /dev/null
@@ -1,27 +0,0 @@
-function run_test()
-{
-  do_get_profile();
-
-  if (!newCacheBackEndUsed()) {
-    do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
-    return;
-  }
-
-  // Open for write, but never write and never mark valid
-  asyncOpenCacheEntry("http://no-data/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
-    new OpenCallback(NEW|METAONLY|DONTSETVALID|WAITFORWRITE, "meta", "", function(entry) {
-      // Open again, we must get the callback and zero-length data
-      do_execute_soon(() => {
-        Cu.forceGC(); // invokes OnHandleClosed on the entry
-
-        asyncOpenCacheEntry("http://no-data/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
-          new OpenCallback(NORMAL, "meta", "", function(entry) {
-            finish_cache2_test();
-          })
-        );
-      });
-    })
-  );
-
-  do_test_pending();
-}
--- a/netwerk/test/unit/xpcshell.ini
+++ b/netwerk/test/unit/xpcshell.ini
@@ -59,17 +59,16 @@ skip-if = os == "android"
 [test_cache2-19-range-206.js]
 [test_cache2-20-range-200.js]
 [test_cache2-21-anon-storage.js]
 [test_cache2-22-anon-visit.js]
 [test_cache2-23-read-over-chunk.js]
 [test_cache2-24-exists.js]
 # Bug 675039, comment 6: "The difference is that the memory cache is disabled in Armv6 builds."
 skip-if = os == "android"
-[test_cache2-26-no-outputstream-open.js]
 [test_304_responses.js]
 # Bug 675039: test hangs on Android-armv6 
 skip-if = os == "android"
 [test_cacheForOfflineUse_no-store.js]
 [test_307_redirect.js]
 [test_NetUtil.js]
 [test_URIs.js]
 [test_aboutblank.js]