Bug 1430237 - remove newSimpleNestedURI from nsINetUtil, r?mayhemer draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 15 Jan 2018 11:51:24 +0000
changeset 720384 57f6cf14c6d7f04753090be42da1975f5898f84e
parent 720380 b7d66e4e60ef177ec9ae687daa29443ae4a2acfc
child 746051 e99d178bd562dcff84c4094090dc77adf632ea64
push id95530
push usergijskruitbosch@gmail.com
push dateMon, 15 Jan 2018 11:51:55 +0000
reviewersmayhemer
bugs1430237
milestone59.0a1
Bug 1430237 - remove newSimpleNestedURI from nsINetUtil, r?mayhemer MozReview-Commit-ID: 74RsNo60Kfh
netwerk/base/nsINetUtil.idl
netwerk/base/nsIOService.cpp
--- a/netwerk/base/nsINetUtil.idl
+++ b/netwerk/base/nsINetUtil.idl
@@ -78,23 +78,16 @@ interface nsINetUtil : nsISupports
   /**
    * Take aURI and produce an immutable version of it for the caller.  If aURI
    * is immutable this will be aURI itself; otherwise this will be a clone,
    * marked immutable if possible.  Passing null to this method is allowed; in
    * that case it will return null.
    */
   nsIURI toImmutableURI(in nsIURI aURI);
 
-  /**
-   * Create a simple nested URI using the result of
-   * toImmutableURI on the passed-in aURI which may not be null.
-   * Note: The return URI will not have had its spec set yet.
-   */
-  nsIURI newSimpleNestedURI(in nsIURI aURI);
-
   /** Escape every character with its %XX-escaped equivalent */
   const unsigned long ESCAPE_ALL = 0;
 
   /** Leave alphanumeric characters intact and %XX-escape all others */
   const unsigned long ESCAPE_XALPHAS = 1;
 
   /** Leave alphanumeric characters intact, convert spaces to '+',
       %XX-escape all others */
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -1570,29 +1570,16 @@ nsIOService::ToImmutableURI(nsIURI* uri,
     nsresult rv = NS_EnsureSafeToReturn(uri, result);
     NS_ENSURE_SUCCESS(rv, rv);
 
     NS_TryToSetImmutable(*result);
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIOService::NewSimpleNestedURI(nsIURI* aURI, nsIURI** aResult)
-{
-    NS_ENSURE_ARG(aURI);
-
-    nsCOMPtr<nsIURI> safeURI;
-    nsresult rv = NS_EnsureSafeToReturn(aURI, getter_AddRefs(safeURI));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    NS_IF_ADDREF(*aResult = new nsSimpleNestedURI(safeURI));
-    return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
-}
-
-NS_IMETHODIMP
 nsIOService::SetManageOfflineStatus(bool aManage)
 {
     LOG(("nsIOService::SetManageOfflineStatus aManage=%d\n", aManage));
     mManageLinkStatus = aManage;
 
     // When detection is not activated, the default connectivity state is true.
     if (!mManageLinkStatus) {
         SetConnectivityInternal(true);