Bug 1432257 - Remove nsIStandardURL setter methods r=mayhemer
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 22 Jan 2018 20:20:18 +0100
changeset 402193 0aa414efaff9fec661d00c35e835ca50a15f046d
parent 402192 840e2763fe9408e4dee544c9b0e9df76ee4c1d00
child 402194 9ffe77b5c891cecc4f39d411be9d33d108d2b433
push id33371
push userccoroiu@mozilla.com
push dateFri, 02 Feb 2018 17:36:53 +0000
treeherdermozilla-central@9e41a686a5ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1432257
milestone60.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
Bug 1432257 - Remove nsIStandardURL setter methods r=mayhemer * Removes nsIStandardURL.{init,setDefaultPort} as these have been migrated to nsIStandardURLMutator MozReview-Commit-ID: 7JPZmyEr65h
netwerk/base/nsIStandardURL.idl
netwerk/base/nsStandardURL.cpp
netwerk/base/nsStandardURL.h
--- a/netwerk/base/nsIStandardURL.idl
+++ b/netwerk/base/nsIStandardURL.idl
@@ -35,24 +35,16 @@ interface nsIStandardURL : nsIMutable
 
     /**
      * blah:foo/bar    => blah:///foo/bar
      * blah:/foo/bar   => blah:///foo/bar
      * blah://foo/bar  => blah://foo/bar
      * blah:///foo/bar => blah:///foo/bar
      */
     const unsigned long URLTYPE_NO_AUTHORITY    = 3;
-
-    void init(in unsigned long aUrlType,
-              in long aDefaultPort,
-              in AUTF8String aSpec,
-              in string aOriginCharset,
-              in nsIURI aBaseURI);
-
-    void setDefaultPort(in long aNewDefaultPort);
 };
 
 [scriptable, builtinclass, uuid(fc894e98-23a1-43cd-a7fe-72876f8ea2ee)]
 interface nsIStandardURLMutator : nsISupports
 {
     /**
      * Initialize a standard URL.
      *
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -3293,17 +3293,17 @@ nsStandardURL::SetFile(nsIFile *file)
 
     return NS_OK;
 }
 
 //----------------------------------------------------------------------------
 // nsStandardURL::nsIStandardURL
 //----------------------------------------------------------------------------
 
-NS_IMETHODIMP
+nsresult
 nsStandardURL::Init(uint32_t urlType,
                     int32_t defaultPort,
                     const nsACString &spec,
                     const char *charset,
                     nsIURI *baseURI)
 {
     ENSURE_MUTABLE();
 
@@ -3350,17 +3350,17 @@ nsStandardURL::Init(uint32_t urlType,
 
     nsAutoCString buf;
     nsresult rv = baseURI->Resolve(spec, buf);
     if (NS_FAILED(rv)) return rv;
 
     return SetSpecWithEncoding(buf, encoding);
 }
 
-NS_IMETHODIMP
+nsresult
 nsStandardURL::SetDefaultPort(int32_t aNewDefaultPort)
 {
     ENSURE_MUTABLE();
 
     InvalidateCache();
 
     // should never be more than 16 bit
     if (aNewDefaultPort >= std::numeric_limits<uint16_t>::max()) {
--- a/netwerk/base/nsStandardURL.h
+++ b/netwerk/base/nsStandardURL.h
@@ -176,16 +176,20 @@ protected:
 
     // Helper for subclass implementation of GetFile().  Subclasses that map
     // URIs to files in a special way should implement this method.  It should
     // ensure that our mFile is initialized, if it's possible.
     // returns NS_ERROR_NO_INTERFACE if the url does not map to a file
     virtual nsresult EnsureFile();
 
 private:
+    nsresult Init(uint32_t urlType, int32_t defaultPort, const nsACString &spec,
+                  const char *charset, nsIURI *baseURI);
+    nsresult SetDefaultPort(int32_t aNewDefaultPort);
+
     int32_t  Port() { return mPort == -1 ? mDefaultPort : mPort; }
 
     void     ReplacePortInSpec(int32_t aNewPort);
     void     Clear();
     void     InvalidateCache(bool invalidateCachedFile = true);
 
     bool     ValidIPv6orHostname(const char *host, uint32_t aLen);
     static bool     IsValidOfBase(unsigned char c, const uint32_t base);