Bug 1307467 - Remove mAppURI from nsJARChannel r=bagder draft
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 21 Oct 2016 00:24:04 +0200
changeset 427823 79a173ecec12a7b6276eb7d6d003411c14a6b043
parent 427822 4ac6f1461a7d21ded52ca0e08326f6552b1f24b6
child 534562 5c6c1aab51d134bd2f557cb1abdd8a8142d73d7d
push id33125
push uservalentin.gosu@gmail.com
push dateThu, 20 Oct 2016 22:24:57 +0000
reviewersbagder
bugs1307467
milestone52.0a1
Bug 1307467 - Remove mAppURI from nsJARChannel r=bagder MozReview-Commit-ID: CX9TMxY1qZM
modules/libjar/nsIJARChannel.idl
modules/libjar/nsJARChannel.cpp
modules/libjar/nsJARChannel.h
--- a/modules/libjar/nsIJARChannel.idl
+++ b/modules/libjar/nsIJARChannel.idl
@@ -15,21 +15,16 @@ interface nsIJARChannel : nsIChannel
      * Returns TRUE if the JAR file is not safe (if the content type reported
      * by the server for a remote JAR is not of an expected type).  Scripting,
      * redirects, and plugins should be disabled when loading from this
      * channel.
      */
     [infallible] readonly attribute boolean isUnsafe;
 
     /**
-     * Forces the uri to be a app:// uri.
-     */
-    void setAppURI(in nsIURI uri);
-
-    /**
      * Returns the JAR file.  May be null if the jar is remote.
      */
     readonly attribute nsIFile jarFile;
 
     /**
      * Returns the zip entry if the file is synchronously accessible.
      * This will work even without opening the channel.
      */
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -188,17 +188,16 @@ nsJARInputThunk::IsNonBlocking(bool *non
 
 //-----------------------------------------------------------------------------
 // nsJARChannel
 //-----------------------------------------------------------------------------
 
 
 nsJARChannel::nsJARChannel()
     : mOpened(false)
-    , mAppURI(nullptr)
     , mContentDisposition(0)
     , mContentLength(-1)
     , mLoadFlags(LOAD_NORMAL)
     , mStatus(NS_OK)
     , mIsPending(false)
     , mIsUnsafe(true)
     , mBlockRemoteFiles(false)
 {
@@ -518,21 +517,17 @@ nsJARChannel::SetOriginalURI(nsIURI *aUR
     NS_ENSURE_ARG_POINTER(aURI);
     mOriginalURI = aURI;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsJARChannel::GetURI(nsIURI **aURI)
 {
-    if (mAppURI) {
-        NS_IF_ADDREF(*aURI = mAppURI);
-    } else {
-        NS_IF_ADDREF(*aURI = mJarURI);
-    }
+    NS_IF_ADDREF(*aURI = mJarURI);
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsJARChannel::GetOwner(nsISupports **aOwner)
 {
     // JAR signatures are not processed to avoid main-thread network I/O (bug 726125)
@@ -859,30 +854,16 @@ nsJARChannel::AsyncOpen2(nsIStreamListen
 NS_IMETHODIMP
 nsJARChannel::GetIsUnsafe(bool *isUnsafe)
 {
     *isUnsafe = mIsUnsafe;
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::SetAppURI(nsIURI *aURI) {
-    NS_ENSURE_ARG_POINTER(aURI);
-
-    nsAutoCString scheme;
-    aURI->GetScheme(scheme);
-    if (!scheme.EqualsLiteral("app")) {
-        return NS_ERROR_INVALID_ARG;
-    }
-
-    mAppURI = aURI;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
 nsJARChannel::GetJarFile(nsIFile **aFile)
 {
     NS_IF_ADDREF(*aFile = mJarFile);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsJARChannel::GetZipEntry(nsIZipEntry **aZipEntry)
--- a/modules/libjar/nsJARChannel.h
+++ b/modules/libjar/nsJARChannel.h
@@ -67,17 +67,16 @@ private:
         override;
 
     nsCString                       mSpec;
 
     bool                            mOpened;
 
     nsCOMPtr<nsIJARURI>             mJarURI;
     nsCOMPtr<nsIURI>                mOriginalURI;
-    nsCOMPtr<nsIURI>                mAppURI;
     nsCOMPtr<nsISupports>           mOwner;
     nsCOMPtr<nsILoadInfo>           mLoadInfo;
     nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
     nsCOMPtr<nsISupports>           mSecurityInfo;
     nsCOMPtr<nsIProgressEventSink>  mProgressSink;
     nsCOMPtr<nsILoadGroup>          mLoadGroup;
     nsCOMPtr<nsIStreamListener>     mListener;
     nsCOMPtr<nsISupports>           mListenerContext;