Bug 1282750 - Convert AboutCache to use AsyncOpen2() r=honza
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Wed, 29 Jun 2016 15:42:13 +0200
changeset 383218 4306097418bfa74f88ac2b922e4cab0eb0fc6f35
parent 383217 5ecebd971de4d59c5fd54cf47842606d025fd0be
child 383219 733e6ac3ee54688ebb80acea0aa23820c7527ec2
push id21963
push userdmitchell@mozilla.com
push dateFri, 01 Jul 2016 19:54:18 +0000
reviewershonza
bugs1282750
milestone50.0a1
Bug 1282750 - Convert AboutCache to use AsyncOpen2() r=honza
netwerk/protocol/about/nsAboutCache.cpp
--- a/netwerk/protocol/about/nsAboutCache.cpp
+++ b/netwerk/protocol/about/nsAboutCache.cpp
@@ -141,48 +141,36 @@ NS_IMETHODIMP nsAboutCache::Channel::Asy
     if (!mChannel) {
         return NS_ERROR_UNEXPECTED;
     }
 
     // Kick the walk loop.
     rv = VisitNextStorage();
     if (NS_FAILED(rv)) return rv;
 
-    rv = mChannel->AsyncOpen(aListener, aContext);
+    MOZ_ASSERT(!aContext, "asyncOpen2() does not take a context argument");
+    rv = NS_MaybeOpenChannelUsingAsyncOpen2(mChannel, aListener);
     if (NS_FAILED(rv)) return rv;
 
     return NS_OK;
 }
 
 NS_IMETHODIMP nsAboutCache::Channel::AsyncOpen2(nsIStreamListener *aListener)
 {
     return AsyncOpen(aListener, nullptr);
 }
 
 NS_IMETHODIMP nsAboutCache::Channel::Open(nsIInputStream * *_retval)
 {
-    nsresult rv;
-
-    if (!mChannel) {
-        return NS_ERROR_UNEXPECTED;
-    }
-
-    // Kick the walk loop.
-    rv = VisitNextStorage();
-    if (NS_FAILED(rv)) return rv;
-
-    rv = mChannel->Open(_retval);
-    if (NS_FAILED(rv)) return rv;
-
-    return NS_OK;
+    return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsAboutCache::Channel::Open2(nsIInputStream * *_retval)
 {
-    return Open(_retval);
+    return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsAboutCache::Channel::ParseURI(nsIURI * uri, nsACString & storage)
 {
     //
     // about:cache[?storage=<storage-name>[&context=<context-key>]]
     //