Bug 1067471 - Add newChannel2 to nsIProtocolHandler that takes a loadinfo as an argument (r=sicking)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Wed, 22 Oct 2014 17:16:57 -0700
changeset 236299 9b09703be36f5051bef97bcb45f115b8511164f3
parent 236267 3ab73d1619b993f9c57822527d988dca64877c11
child 236300 7497797d45c422e078162710bc74f1406ab4fd57
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1067471
milestone36.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 1067471 - Add newChannel2 to nsIProtocolHandler that takes a loadinfo as an argument (r=sicking)
chrome/nsChromeProtocolHandler.cpp
content/base/public/nsHostObjectProtocolHandler.h
content/base/src/nsHostObjectProtocolHandler.cpp
dom/jsurl/nsJSProtocolHandler.cpp
extensions/gio/nsGIOProtocolHandler.cpp
extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
image/decoders/icon/nsIconProtocolHandler.cpp
modules/libjar/nsJARProtocolHandler.cpp
netwerk/base/public/nsIProtocolHandler.idl
netwerk/base/public/nsIProxiedProtocolHandler.idl
netwerk/protocol/about/nsAboutProtocolHandler.cpp
netwerk/protocol/app/AppProtocolHandler.cpp
netwerk/protocol/data/nsDataHandler.cpp
netwerk/protocol/device/nsDeviceProtocolHandler.cpp
netwerk/protocol/file/nsFileProtocolHandler.cpp
netwerk/protocol/ftp/nsFtpProtocolHandler.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/res/nsResProtocolHandler.cpp
netwerk/protocol/rtsp/RtspHandler.cpp
netwerk/protocol/viewsource/nsViewSourceHandler.cpp
netwerk/protocol/websocket/BaseWebSocketChannel.cpp
netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp
toolkit/components/places/nsAnnoProtocolHandler.cpp
uriloader/exthandler/nsExternalProtocolHandler.cpp
widget/android/nsAndroidProtocolHandler.cpp
--- a/chrome/nsChromeProtocolHandler.cpp
+++ b/chrome/nsChromeProtocolHandler.cpp
@@ -94,18 +94,19 @@ nsChromeProtocolHandler::NewURI(const ns
 
     surl->SetMutable(false);
 
     NS_ADDREF(*result = url);
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
-                                    nsIChannel* *aResult)
+nsChromeProtocolHandler::NewChannel2(nsIURI* aURI,
+                                     nsILoadInfo* aLoadinfo,
+                                     nsIChannel** aResult)
 {
     nsresult rv;
 
     NS_ENSURE_ARG_POINTER(aURI);
     NS_PRECONDITION(aResult, "Null out param");
 
 #ifdef DEBUG
     // Check that the uri we got is already canonified
@@ -202,9 +203,16 @@ nsChromeProtocolHandler::NewChannel(nsIU
     // See bug 531886, bug 533038.
     result->SetContentCharset(NS_LITERAL_CSTRING("UTF-8"));
 
     *aResult = result;
     NS_ADDREF(*aResult);
     return NS_OK;
 }
 
+NS_IMETHODIMP
+nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
+                                    nsIChannel* *aResult)
+{
+  return NewChannel2(aURI, nullptr, aResult);
+}
+
 ////////////////////////////////////////////////////////////////////////////////
--- a/content/base/public/nsHostObjectProtocolHandler.h
+++ b/content/base/public/nsHostObjectProtocolHandler.h
@@ -34,16 +34,17 @@ public:
   nsHostObjectProtocolHandler();
   NS_DECL_ISUPPORTS
 
   // nsIProtocolHandler methods, except for GetScheme which is only defined
   // in subclasses.
   NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) MOZ_OVERRIDE;
   NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) MOZ_OVERRIDE;
   NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) MOZ_OVERRIDE;
+  NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel * *_retval) MOZ_OVERRIDE;
   NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel * *_retval) MOZ_OVERRIDE;
   NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) MOZ_OVERRIDE;
 
   // If principal is not null, its origin will be used to generate the URI.
   static nsresult GenerateURIString(const nsACString &aScheme,
                                     nsIPrincipal* aPrincipal,
                                     nsACString &aUri);
 
--- a/content/base/src/nsHostObjectProtocolHandler.cpp
+++ b/content/base/src/nsHostObjectProtocolHandler.cpp
@@ -479,17 +479,19 @@ nsHostObjectProtocolHandler::NewURI(cons
 
   NS_TryToSetImmutable(uri);
   uri.forget(aResult);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHostObjectProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+nsHostObjectProtocolHandler::NewChannel2(nsIURI* uri,
+                                         nsILoadInfo *aLoadinfo,
+                                         nsIChannel** result)
 {
   *result = nullptr;
 
   nsCString spec;
   uri->GetSpec(spec);
 
   DataInfo* info = GetDataInfo(spec);
 
@@ -546,16 +548,22 @@ nsHostObjectProtocolHandler::NewChannel(
   channel->SetContentLength(size);
 
   channel.forget(result);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsHostObjectProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+{
+  return NewChannel2(uri, nullptr, result);
+}
+
+NS_IMETHODIMP
 nsHostObjectProtocolHandler::AllowPort(int32_t port, const char *scheme,
                                        bool *_retval)
 {
   // don't override anything.
   *_retval = false;
   return NS_OK;
 }
 
--- a/dom/jsurl/nsJSProtocolHandler.cpp
+++ b/dom/jsurl/nsJSProtocolHandler.cpp
@@ -1202,17 +1202,19 @@ nsJSProtocolHandler::NewURI(const nsACSt
         return rv;
     }
 
     url.forget(result);
     return rv;
 }
 
 NS_IMETHODIMP
-nsJSProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+nsJSProtocolHandler::NewChannel2(nsIURI* uri,
+                                 nsILoadInfo* aLoadInfo,
+                                 nsIChannel** result)
 {
     nsresult rv;
     nsJSChannel * channel;
 
     NS_ENSURE_ARG_POINTER(uri);
 
     channel = new nsJSChannel();
     if (!channel) {
@@ -1224,16 +1226,22 @@ nsJSProtocolHandler::NewChannel(nsIURI* 
     if (NS_SUCCEEDED(rv)) {
         *result = channel;
         NS_ADDREF(*result);
     }
     NS_RELEASE(channel);
     return rv;
 }
 
+NS_IMETHODIMP
+nsJSProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+{
+    return NewChannel2(uri, nullptr, result);
+}
+
 NS_IMETHODIMP 
 nsJSProtocolHandler::AllowPort(int32_t port, const char *scheme, bool *_retval)
 {
     // don't override anything.  
     *_retval = false;
     return NS_OK;
 }
 
--- a/extensions/gio/nsGIOProtocolHandler.cpp
+++ b/extensions/gio/nsGIOProtocolHandler.cpp
@@ -1041,17 +1041,19 @@ nsGIOProtocolHandler::NewURI(const nsACS
                  aOriginCharset, aBaseURI);
   if (NS_SUCCEEDED(rv))
     rv = CallQueryInterface(url, aResult);
   return rv;
 
 }
 
 NS_IMETHODIMP
-nsGIOProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult)
+nsGIOProtocolHandler::NewChannel2(nsIURI* aURI,
+                                  nsILoadInfo* aLoadInfo,
+                                  nsIChannel** aResult)
 {
   NS_ENSURE_ARG_POINTER(aURI);
   nsresult rv;
 
   nsAutoCString spec;
   rv = aURI->GetSpec(spec);
   if (NS_FAILED(rv))
     return rv;
@@ -1078,16 +1080,22 @@ nsGIOProtocolHandler::NewChannel(nsIURI 
                                   NS_LITERAL_CSTRING(UNKNOWN_CONTENT_TYPE));
     if (NS_SUCCEEDED(rv))
       stream->SetChannel(*aResult);
   }
   return rv;
 }
 
 NS_IMETHODIMP
+nsGIOProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult)
+{
+    return NewChannel2(aURI, nullptr, aResult);
+}
+
+NS_IMETHODIMP
 nsGIOProtocolHandler::AllowPort(int32_t aPort,
                                 const char *aScheme,
                                 bool *aResult)
 {
   // Don't override anything.
   *aResult = false;
   return NS_OK;
 }
--- a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
+++ b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
@@ -894,17 +894,19 @@ nsGnomeVFSProtocolHandler::NewURI(const 
                  aOriginCharset, aBaseURI);
   if (NS_SUCCEEDED(rv))
     rv = CallQueryInterface(url, aResult);
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsGnomeVFSProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult)
+nsGnomeVFSProtocolHandler::NewChannel2(nsIURI* aURI,
+                                       nsILoadInfo* aLoadInfo,
+                                       nsIChannel** aResult)
 {
   NS_ENSURE_ARG_POINTER(aURI);
   nsresult rv;
 
   nsAutoCString spec;
   rv = aURI->GetSpec(spec);
   if (NS_FAILED(rv))
     return rv;
@@ -922,16 +924,22 @@ nsGnomeVFSProtocolHandler::NewChannel(ns
                                   NS_LITERAL_CSTRING(UNKNOWN_CONTENT_TYPE));
     if (NS_SUCCEEDED(rv))
       stream->SetChannel(*aResult);
   }
   return rv;
 }
 
 NS_IMETHODIMP
+nsGnomeVFSProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult)
+{
+    return NewChannel2(aURI, nullptr, aResult);
+}
+
+NS_IMETHODIMP
 nsGnomeVFSProtocolHandler::AllowPort(int32_t aPort,
                                      const char *aScheme,
                                      bool *aResult)
 {
   // Don't override anything.
   *aResult = false; 
   return NS_OK;
 }
--- a/image/decoders/icon/nsIconProtocolHandler.cpp
+++ b/image/decoders/icon/nsIconProtocolHandler.cpp
@@ -66,17 +66,20 @@ NS_IMETHODIMP nsIconProtocolHandler::New
 
   nsresult rv = uri->SetSpec(aSpec);
   if (NS_FAILED(rv)) return rv;
 
   NS_ADDREF(*result = uri);
   return NS_OK;
 }
 
-NS_IMETHODIMP nsIconProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
+NS_IMETHODIMP
+nsIconProtocolHandler::NewChannel2(nsIURI* url,
+                                   nsILoadInfo* aLoadInfo,
+                                   nsIChannel** result)
 {
   NS_ENSURE_ARG_POINTER(url);
   nsIconChannel* channel = new nsIconChannel;
   if (!channel)
     return NS_ERROR_OUT_OF_MEMORY;
   NS_ADDREF(channel);
 
   nsresult rv = channel->Init(url);
@@ -84,9 +87,14 @@ NS_IMETHODIMP nsIconProtocolHandler::New
     NS_RELEASE(channel);
     return rv;
   }
 
   *result = channel;
   return NS_OK;
 }
 
+NS_IMETHODIMP nsIconProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
+{
+  return NewChannel2(url, nullptr, result);
+}
+
 ////////////////////////////////////////////////////////////////////////////////
--- a/modules/libjar/nsJARProtocolHandler.cpp
+++ b/modules/libjar/nsJARProtocolHandler.cpp
@@ -203,33 +203,41 @@ nsJARProtocolHandler::NewURI(const nsACS
     if (NS_FAILED(rv))
         return rv;
 
     NS_ADDREF(*result = jarURI);
     return rv;
 }
 
 NS_IMETHODIMP
-nsJARProtocolHandler::NewChannel(nsIURI *uri, nsIChannel **result)
+nsJARProtocolHandler::NewChannel2(nsIURI* uri,
+                                  nsILoadInfo* aLoadInfo,
+                                  nsIChannel** result)
 {
     nsJARChannel *chan = new nsJARChannel();
     if (!chan)
         return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(chan);
 
     nsresult rv = chan->Init(uri);
     if (NS_FAILED(rv)) {
         NS_RELEASE(chan);
         return rv;
     }
 
     *result = chan;
     return NS_OK;
 }
 
+NS_IMETHODIMP
+nsJARProtocolHandler::NewChannel(nsIURI *uri, nsIChannel **result)
+{
+    return NewChannel2(uri, nullptr, result);
+}
+
 
 NS_IMETHODIMP
 nsJARProtocolHandler::AllowPort(int32_t port, const char *scheme, bool *_retval)
 {
     // don't override anything.
     *_retval = false;
     return NS_OK;
 }
--- a/netwerk/base/public/nsIProtocolHandler.idl
+++ b/netwerk/base/public/nsIProtocolHandler.idl
@@ -2,21 +2,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIURI;
 interface nsIChannel;
+interface nsILoadInfo;
 
 /**
  * nsIProtocolHandler
  */
-[scriptable, uuid(f5753fec-a051-4ddc-8891-11f1f1575072)]
+[scriptable, uuid(a7aad716-e72c-435d-82f1-7582dffae661)]
 interface nsIProtocolHandler : nsISupports
 {
     /**
      * The scheme of this protocol (e.g., "file").
      */
     readonly attribute ACString scheme;
 
     /** 
@@ -56,17 +57,23 @@ interface nsIProtocolHandler : nsISuppor
      *                         If the protocol has no concept of relative 
      *                         URI aBaseURI will simply be ignored.
      */
     nsIURI newURI(in AUTF8String aSpec,
                   in string aOriginCharset,
                   in nsIURI aBaseURI);
 
     /**
-     * Constructs a new channel from the given URI for this protocol handler. 
+     * Constructs a new channel from the given URI for this protocol handler and
+     * sets the loadInfo for the constructed channel.
+     */
+    nsIChannel newChannel2(in nsIURI aURI, in nsILoadInfo aLoadinfo);
+
+    /**
+     * Constructs a new channel from the given URI for this protocol handler.
      */
     nsIChannel newChannel(in nsIURI aURI);
 
     /**
      * Allows a protocol to override blacklisted ports.
      *
      * This method will be called when there is an attempt to connect to a port 
      * that is blacklisted.  For example, for most protocols, port 25 (Simple Mail
--- a/netwerk/base/public/nsIProxiedProtocolHandler.idl
+++ b/netwerk/base/public/nsIProxiedProtocolHandler.idl
@@ -3,18 +3,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIProtocolHandler.idl"
 
 interface nsIChannel;
 interface nsIURI;
 interface nsIProxyInfo;
+interface nsILoadInfo;
 
-[scriptable, uuid(2b63fe69-b0fc-48f2-a2df-adb795a4ce5c)]
+[scriptable, uuid(3756047a-fa2b-4b45-9948-3b5f8fc375e7)]
 interface nsIProxiedProtocolHandler : nsIProtocolHandler
 {
     /** Create a new channel with the given proxyInfo
      *
      * @param uri the channel uri
      * @param proxyInfo any proxy information that has already been determined,
      *        or null if channel should later determine the proxy on its own using
      *        proxyResolveFlags/proxyURI
@@ -22,13 +23,32 @@ interface nsIProxiedProtocolHandler : ns
      *        from nsIProtocolProxyService::asyncResolve
      * @param proxyURI used if the proxy is later determined from
      *        nsIProtocolProxyService::asyncResolve with this as the proxyURI name.
      *        Generally this is the same as uri (or null which has the same
      *        effect), except in the case of websockets which wants to bootstrap
      *        to an http:// channel but make its proxy determination based on
      *        a ws:// uri.
      */
+    nsIChannel newProxiedChannel2(in nsIURI uri, in nsIProxyInfo proxyInfo,
+                                  in unsigned long proxyResolveFlags,
+                                  in nsIURI proxyURI,
+                                  in nsILoadInfo aLoadInfo);
+
+    /** Create a new channel with the given proxyInfo
+     *
+     * @param uri the channel uri
+     * @param proxyInfo any proxy information that has already been determined,
+     *        or null if channel should later determine the proxy on its own using
+     *        proxyResolveFlags/proxyURI
+     * @param proxyResolveFlags used if the proxy is later determined
+     *        from nsIProtocolProxyService::asyncResolve
+     * @param proxyURI used if the proxy is later determined from
+     *        nsIProtocolProxyService::asyncResolve with this as the proxyURI name.
+     *        Generally this is the same as uri (or null which has the same
+     *        effect), except in the case of websockets which wants to bootstrap
+     *        to an http:// channel but make its proxy determination based on
+     *        a ws:// uri.
+     */
     nsIChannel newProxiedChannel(in nsIURI uri, in nsIProxyInfo proxyInfo,
                                  in unsigned long proxyResolveFlags,
                                  in nsIURI proxyURI);
 };
-
--- a/netwerk/protocol/about/nsAboutProtocolHandler.cpp
+++ b/netwerk/protocol/about/nsAboutProtocolHandler.cpp
@@ -113,17 +113,19 @@ nsAboutProtocolHandler::NewURI(const nsA
     // We don't want to allow mutation, since it would allow safe and
     // unsafe URIs to change into each other...
     NS_TryToSetImmutable(url);
     url.swap(*result);
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAboutProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+nsAboutProtocolHandler::NewChannel2(nsIURI* uri,
+                                    nsILoadInfo* aLoadInfo,
+                                    nsIChannel** result)
 {
     NS_ENSURE_ARG_POINTER(uri);
 
     // about:what you ask?
     nsCOMPtr<nsIAboutModule> aboutMod;
     nsresult rv = NS_GetAboutModule(uri, getter_AddRefs(aboutMod));
 
     nsAutoCString path;
@@ -171,16 +173,22 @@ nsAboutProtocolHandler::NewChannel(nsIUR
         // This looks like an about: we don't know about.  Convert
         // this to an invalid URI error.
         rv = NS_ERROR_MALFORMED_URI;
     }
 
     return rv;
 }
 
+NS_IMETHODIMP
+nsAboutProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+{
+    return NewChannel2(uri, nullptr, result);
+}
+
 NS_IMETHODIMP 
 nsAboutProtocolHandler::AllowPort(int32_t port, const char *scheme, bool *_retval)
 {
     // don't override anything.  
     *_retval = false;
     return NS_OK;
 }
 
@@ -231,16 +239,25 @@ nsSafeAboutProtocolHandler::NewURI(const
     NS_TryToSetImmutable(url);
     
     *result = nullptr;
     url.swap(*result);
     return rv;
 }
 
 NS_IMETHODIMP
+nsSafeAboutProtocolHandler::NewChannel2(nsIURI* uri,
+                                        nsILoadInfo* aLoadInfo,
+                                        nsIChannel** result)
+{
+    *result = nullptr;
+    return NS_ERROR_NOT_AVAILABLE;
+}
+
+NS_IMETHODIMP
 nsSafeAboutProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
 {
     *result = nullptr;
     return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP 
 nsSafeAboutProtocolHandler::AllowPort(int32_t port, const char *scheme, bool *_retval)
--- a/netwerk/protocol/app/AppProtocolHandler.cpp
+++ b/netwerk/protocol/app/AppProtocolHandler.cpp
@@ -370,20 +370,20 @@ AppProtocolHandler::NewURI(const nsACStr
 
   nsCOMPtr<nsIURL> url(do_QueryInterface(surl, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   url.forget(result);
   return NS_OK;
 }
 
-// We map app://ABCDEF/path/to/file.ext to
-// jar:file:///path/to/profile/webapps/ABCDEF/application.zip!/path/to/file.ext
 NS_IMETHODIMP
-AppProtocolHandler::NewChannel(nsIURI* aUri, nsIChannel* *aResult)
+AppProtocolHandler::NewChannel2(nsIURI* aUri,
+                                nsILoadInfo* aLoadInfo,
+                                nsIChannel** aResult)
 {
   NS_ENSURE_ARG_POINTER(aUri);
   nsRefPtr<nsJARChannel> channel = new nsJARChannel();
 
   nsAutoCString host;
   nsresult rv = aUri->GetHost(host);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -461,16 +461,24 @@ AppProtocolHandler::NewChannel(nsIURI* a
 
   rv = channel->SetOriginalURI(aUri);
   NS_ENSURE_SUCCESS(rv, rv);
 
   channel.forget(aResult);
   return NS_OK;
 }
 
+// We map app://ABCDEF/path/to/file.ext to
+// jar:file:///path/to/profile/webapps/ABCDEF/application.zip!/path/to/file.ext
+NS_IMETHODIMP
+AppProtocolHandler::NewChannel(nsIURI* aUri, nsIChannel* *aResult)
+{
+  return NewChannel2(aUri, nullptr, aResult);
+}
+
 NS_IMETHODIMP
 AppProtocolHandler::AllowPort(int32_t aPort, const char *aScheme, bool *aRetval)
 {
   // No port allowed for this scheme.
   *aRetval = false;
   return NS_OK;
 }
 
--- a/netwerk/protocol/data/nsDataHandler.cpp
+++ b/netwerk/protocol/data/nsDataHandler.cpp
@@ -98,33 +98,42 @@ nsDataHandler::NewURI(const nsACString &
     if (NS_FAILED(rv))
         return rv;
 
     uri.forget(result);
     return rv;
 }
 
 NS_IMETHODIMP
-nsDataHandler::NewChannel(nsIURI* uri, nsIChannel* *result) {
+nsDataHandler::NewChannel2(nsIURI* uri,
+                           nsILoadInfo* aLoadInfo,
+                           nsIChannel** result)
+{
     NS_ENSURE_ARG_POINTER(uri);
     nsDataChannel* channel = new nsDataChannel(uri);
     if (!channel)
         return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(channel);
 
     nsresult rv = channel->Init();
     if (NS_FAILED(rv)) {
         NS_RELEASE(channel);
         return rv;
     }
 
     *result = channel;
     return NS_OK;
 }
 
+NS_IMETHODIMP
+nsDataHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+{
+    return NewChannel2(uri, nullptr, result);
+}
+
 NS_IMETHODIMP 
 nsDataHandler::AllowPort(int32_t port, const char *scheme, bool *_retval) {
     // don't override anything.  
     *_retval = false;
     return NS_OK;
 }
 
 #define BASE64_EXTENSION ";base64"
--- a/netwerk/protocol/device/nsDeviceProtocolHandler.cpp
+++ b/netwerk/protocol/device/nsDeviceProtocolHandler.cpp
@@ -49,25 +49,33 @@ nsDeviceProtocolHandler::NewURI(const ns
 
   nsresult rv = uri->SetSpec(spec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return CallQueryInterface(uri, result);
 }
 
 NS_IMETHODIMP
-nsDeviceProtocolHandler::NewChannel(nsIURI* aURI, nsIChannel **aResult)
+nsDeviceProtocolHandler::NewChannel2(nsIURI* aURI,
+                                     nsILoadInfo* aLoadInfo,
+                                     nsIChannel** aResult)
 {
   nsRefPtr<nsDeviceChannel> channel = new nsDeviceChannel();
   nsresult rv = channel->Init(aURI);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return CallQueryInterface(channel, aResult);
 }
 
+NS_IMETHODIMP
+nsDeviceProtocolHandler::NewChannel(nsIURI* aURI, nsIChannel **aResult)
+{
+  return NewChannel2(aURI, nullptr, aResult);
+}
+
 NS_IMETHODIMP 
 nsDeviceProtocolHandler::AllowPort(int32_t port,
                                    const char *scheme,
                                    bool *aResult)
 {
   // don't override anything.  
   *aResult = false;
   return NS_OK;
--- a/netwerk/protocol/file/nsFileProtocolHandler.cpp
+++ b/netwerk/protocol/file/nsFileProtocolHandler.cpp
@@ -172,33 +172,41 @@ nsFileProtocolHandler::NewURI(const nsAC
     nsresult rv = url->Init(nsIStandardURL::URLTYPE_NO_AUTHORITY, -1,
                             *specPtr, charset, baseURI);
     if (NS_FAILED(rv)) return rv;
 
     return CallQueryInterface(url, result);
 }
 
 NS_IMETHODIMP
-nsFileProtocolHandler::NewChannel(nsIURI *uri, nsIChannel **result)
+nsFileProtocolHandler::NewChannel2(nsIURI* uri,
+                                   nsILoadInfo* aLoadInfo,
+                                   nsIChannel** result)
 {
     nsFileChannel *chan = new nsFileChannel(uri);
     if (!chan)
         return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(chan);
 
     nsresult rv = chan->Init();
     if (NS_FAILED(rv)) {
         NS_RELEASE(chan);
         return rv;
     }
 
     *result = chan;
     return NS_OK;
 }
 
+NS_IMETHODIMP
+nsFileProtocolHandler::NewChannel(nsIURI *uri, nsIChannel **result)
+{
+    return NewChannel2(uri, nullptr, result);
+}
+
 NS_IMETHODIMP 
 nsFileProtocolHandler::AllowPort(int32_t port, const char *scheme, bool *result)
 {
     // don't override anything.  
     *result = false;
     return NS_OK;
 }
 
--- a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp
+++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp
@@ -198,26 +198,35 @@ nsFtpProtocolHandler::NewURI(const nsACS
 
     rv = url->Init(nsIStandardURL::URLTYPE_AUTHORITY, 21, aSpec, aCharset, aBaseURI);
     if (NS_FAILED(rv)) return rv;
 
     return CallQueryInterface(url, result);
 }
 
 NS_IMETHODIMP
-nsFtpProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
+nsFtpProtocolHandler::NewChannel2(nsIURI* url,
+                                  nsILoadInfo* aLoadInfo,
+                                  nsIChannel** result)
 {
     return NewProxiedChannel(url, nullptr, 0, nullptr, result);
 }
 
 NS_IMETHODIMP
-nsFtpProtocolHandler::NewProxiedChannel(nsIURI* uri, nsIProxyInfo* proxyInfo,
-                                        uint32_t proxyResolveFlags,
-                                        nsIURI *proxyURI,
-                                        nsIChannel* *result)
+nsFtpProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
+{
+    return NewChannel2(url, nullptr, result);
+}
+
+NS_IMETHODIMP
+nsFtpProtocolHandler::NewProxiedChannel2(nsIURI* uri, nsIProxyInfo* proxyInfo,
+                                         uint32_t proxyResolveFlags,
+                                         nsIURI *proxyURI,
+                                         nsILoadInfo* aLoadInfo,
+                                         nsIChannel* *result)
 {
     NS_ENSURE_ARG_POINTER(uri);
     nsRefPtr<nsBaseChannel> channel;
     if (IsNeckoChild())
         channel = new FTPChannelChild(uri);
     else
         channel = new nsFtpChannel(uri, proxyInfo);
 
@@ -225,16 +234,27 @@ nsFtpProtocolHandler::NewProxiedChannel(
     if (NS_FAILED(rv)) {
         return rv;
     }
     
     channel.forget(result);
     return rv;
 }
 
+NS_IMETHODIMP
+nsFtpProtocolHandler::NewProxiedChannel(nsIURI* uri, nsIProxyInfo* proxyInfo,
+                                        uint32_t proxyResolveFlags,
+                                        nsIURI *proxyURI,
+                                        nsIChannel* *result)
+{
+  return NewProxiedChannel2(uri, proxyInfo, proxyResolveFlags,
+                            proxyURI, nullptr /*loadinfo*/,
+                            result);
+}
+
 NS_IMETHODIMP 
 nsFtpProtocolHandler::AllowPort(int32_t port, const char *scheme, bool *_retval)
 {
     *_retval = (port == 21 || port == 22);
     return NS_OK;
 }
 
 // connection cache methods
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -1675,17 +1675,19 @@ nsHttpHandler::NewURI(const nsACString &
                       const char *aCharset,
                       nsIURI *aBaseURI,
                       nsIURI **aURI)
 {
     return mozilla::net::NewURI(aSpec, aCharset, aBaseURI, NS_HTTP_DEFAULT_PORT, aURI);
 }
 
 NS_IMETHODIMP
-nsHttpHandler::NewChannel(nsIURI *uri, nsIChannel **result)
+nsHttpHandler::NewChannel2(nsIURI* uri,
+                           nsILoadInfo* aLoadInfo,
+                           nsIChannel** result)
 {
     LOG(("nsHttpHandler::NewChannel\n"));
 
     NS_ENSURE_ARG_POINTER(uri);
     NS_ENSURE_ARG_POINTER(result);
 
     bool isHttp = false, isHttps = false;
 
@@ -1700,33 +1702,40 @@ nsHttpHandler::NewChannel(nsIURI *uri, n
             return NS_ERROR_UNEXPECTED;
         }
     }
 
     return NewProxiedChannel(uri, nullptr, 0, nullptr, result);
 }
 
 NS_IMETHODIMP
+nsHttpHandler::NewChannel(nsIURI *uri, nsIChannel **result)
+{
+    return NewChannel2(uri, nullptr, result);
+}
+
+NS_IMETHODIMP
 nsHttpHandler::AllowPort(int32_t port, const char *scheme, bool *_retval)
 {
     // don't override anything.
     *_retval = false;
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpHandler::nsIProxiedProtocolHandler
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsHttpHandler::NewProxiedChannel(nsIURI *uri,
-                                 nsIProxyInfo* givenProxyInfo,
-                                 uint32_t proxyResolveFlags,
-                                 nsIURI *proxyURI,
-                                 nsIChannel **result)
+nsHttpHandler::NewProxiedChannel2(nsIURI *uri,
+                                  nsIProxyInfo* givenProxyInfo,
+                                  uint32_t proxyResolveFlags,
+                                  nsIURI *proxyURI,
+                                  nsILoadInfo* aLoadInfo,
+                                  nsIChannel** result)
 {
     nsRefPtr<HttpBaseChannel> httpChannel;
 
     LOG(("nsHttpHandler::NewProxiedChannel [proxyInfo=%p]\n",
         givenProxyInfo));
 
     nsCOMPtr<nsProxyInfo> proxyInfo;
     if (givenProxyInfo) {
@@ -1761,16 +1770,28 @@ nsHttpHandler::NewProxiedChannel(nsIURI 
     rv = httpChannel->Init(uri, caps, proxyInfo, proxyResolveFlags, proxyURI);
     if (NS_FAILED(rv))
         return rv;
 
     httpChannel.forget(result);
     return NS_OK;
 }
 
+NS_IMETHODIMP
+nsHttpHandler::NewProxiedChannel(nsIURI *uri,
+                                 nsIProxyInfo* givenProxyInfo,
+                                 uint32_t proxyResolveFlags,
+                                 nsIURI *proxyURI,
+                                 nsIChannel **result)
+{
+    return NewProxiedChannel2(uri, givenProxyInfo,
+                              proxyResolveFlags, proxyURI,
+                              nullptr, result);
+}
+
 //-----------------------------------------------------------------------------
 // nsHttpHandler::nsIHttpProtocolHandler
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsHttpHandler::GetUserAgent(nsACString &value)
 {
     value = UserAgent();
@@ -2052,25 +2073,33 @@ nsHttpsHandler::NewURI(const nsACString 
                        const char *aOriginCharset,
                        nsIURI *aBaseURI,
                        nsIURI **_retval)
 {
     return mozilla::net::NewURI(aSpec, aOriginCharset, aBaseURI, NS_HTTPS_DEFAULT_PORT, _retval);
 }
 
 NS_IMETHODIMP
-nsHttpsHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
+nsHttpsHandler::NewChannel2(nsIURI* aURI,
+                            nsILoadInfo* aLoadInfo,
+                            nsIChannel** _retval)
 {
     MOZ_ASSERT(gHttpHandler);
     if (!gHttpHandler)
       return NS_ERROR_UNEXPECTED;
     return gHttpHandler->NewChannel(aURI, _retval);
 }
 
 NS_IMETHODIMP
+nsHttpsHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
+{
+    return NewChannel2(aURI, nullptr, _retval);
+}
+
+NS_IMETHODIMP
 nsHttpsHandler::AllowPort(int32_t aPort, const char *aScheme, bool *_retval)
 {
     // don't override anything.
     *_retval = false;
     return NS_OK;
 }
 
 } // namespace mozilla::net
--- a/netwerk/protocol/res/nsResProtocolHandler.cpp
+++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
@@ -274,17 +274,19 @@ nsResProtocolHandler::NewURI(const nsACS
     rv = resURL->Init(nsIStandardURL::URLTYPE_STANDARD, -1, spec, aCharset, aBaseURI);
     if (NS_SUCCEEDED(rv))
         rv = CallQueryInterface(resURL, result);
     NS_RELEASE(resURL);
     return rv;
 }
 
 NS_IMETHODIMP
-nsResProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+nsResProtocolHandler::NewChannel2(nsIURI* uri,
+                                  nsILoadInfo* aLoadInfo,
+                                  nsIChannel** result)
 {
     NS_ENSURE_ARG_POINTER(uri);
     nsresult rv;
     nsAutoCString spec;
 
     rv = ResolveURI(uri, spec);
     if (NS_FAILED(rv)) return rv;
 
@@ -292,16 +294,22 @@ nsResProtocolHandler::NewChannel(nsIURI*
     if (NS_FAILED(rv)) return rv;
 
     nsLoadFlags loadFlags = 0;
     (*result)->GetLoadFlags(&loadFlags);
     (*result)->SetLoadFlags(loadFlags & ~nsIChannel::LOAD_REPLACE);
     return (*result)->SetOriginalURI(uri);
 }
 
+NS_IMETHODIMP
+nsResProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+{
+    return NewChannel2(uri, nullptr, result);
+}
+
 NS_IMETHODIMP 
 nsResProtocolHandler::AllowPort(int32_t port, const char *scheme, bool *_retval)
 {
     // don't override anything.  
     *_retval = false;
     return NS_OK;
 }
 
--- a/netwerk/protocol/rtsp/RtspHandler.cpp
+++ b/netwerk/protocol/rtsp/RtspHandler.cpp
@@ -61,17 +61,19 @@ RtspHandler::NewURI(const nsACString & a
                  aOriginCharset, aBaseURI);
   NS_ENSURE_SUCCESS(rv, rv);
 
   url.forget(aResult);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-RtspHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult)
+RtspHandler::NewChannel2(nsIURI* aURI,
+                         nsILoadInfo* aLoadInfo,
+                         nsIChannel** aResult)
 {
   bool isRtsp = false;
   nsRefPtr<nsBaseChannel> rtspChannel;
 
   nsresult rv = aURI->SchemeIs("rtsp", &isRtsp);
   NS_ENSURE_SUCCESS(rv, rv);
   NS_ENSURE_TRUE(isRtsp, NS_ERROR_UNEXPECTED);
 
@@ -84,16 +86,22 @@ RtspHandler::NewChannel(nsIURI *aURI, ns
   rv = rtspChannel->Init();
   NS_ENSURE_SUCCESS(rv, rv);
 
   rtspChannel.forget(aResult);
   return NS_OK;
 }
 
 NS_IMETHODIMP
+RtspHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult)
+{
+  return NewChannel2(aURI, nullptr, aResult);
+}
+
+NS_IMETHODIMP
 RtspHandler::AllowPort(int32_t port, const char *scheme, bool *aResult)
 {
   // Do not override any blacklisted ports.
   *aResult = false;
   return NS_OK;
 }
 
 } // namespace net
--- a/netwerk/protocol/viewsource/nsViewSourceHandler.cpp
+++ b/netwerk/protocol/viewsource/nsViewSourceHandler.cpp
@@ -85,17 +85,19 @@ nsViewSourceHandler::NewURI(const nsACSt
     // with its inner URI.
     ourURI->SetMutable(false);
 
     uri.swap(*aResult);
     return rv;
 }
 
 NS_IMETHODIMP
-nsViewSourceHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+nsViewSourceHandler::NewChannel2(nsIURI* uri,
+                                 nsILoadInfo* aLoadInfo,
+                                 nsIChannel** result)
 {
     NS_ENSURE_ARG_POINTER(uri);
     nsViewSourceChannel *channel = new nsViewSourceChannel();
     if (!channel)
         return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(channel);
 
     nsresult rv = channel->Init(uri);
@@ -103,16 +105,22 @@ nsViewSourceHandler::NewChannel(nsIURI* 
         NS_RELEASE(channel);
         return rv;
     }
 
     *result = static_cast<nsIViewSourceChannel*>(channel);
     return NS_OK;
 }
 
+NS_IMETHODIMP
+nsViewSourceHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
+{
+    return NewChannel2(uri, nullptr, result);
+}
+
 nsresult
 nsViewSourceHandler::NewSrcdocChannel(nsIURI* uri, const nsAString &srcdoc,
                                       nsIURI* baseURI, nsIChannel* *result)
 {
     NS_ENSURE_ARG_POINTER(uri);
     nsViewSourceChannel *channel = new nsViewSourceChannel();
     if (!channel)
         return NS_ERROR_OUT_OF_MEMORY;
--- a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
@@ -236,16 +236,25 @@ BaseWebSocketChannel::NewURI(const nsACS
                 aOriginCharset, aBaseURI);
   if (NS_FAILED(rv))
     return rv;
   NS_ADDREF(*_retval = url);
   return NS_OK;
 }
 
 NS_IMETHODIMP
+BaseWebSocketChannel::NewChannel2(nsIURI* aURI,
+                                  nsILoadInfo* aLoadInfo,
+                                  nsIChannel** outChannel)
+{
+  LOG(("BaseWebSocketChannel::NewChannel2() %p\n", this));
+  return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
 BaseWebSocketChannel::NewChannel(nsIURI *aURI, nsIChannel **_retval)
 {
   LOG(("BaseWebSocketChannel::NewChannel() %p\n", this));
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 BaseWebSocketChannel::AllowPort(int32_t port, const char *scheme,
--- a/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp
+++ b/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp
@@ -80,17 +80,19 @@ nsWyciwygProtocolHandler::NewURI(const n
 
   *result = url;
   NS_ADDREF(*result);
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsWyciwygProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
+nsWyciwygProtocolHandler::NewChannel2(nsIURI* url,
+                                      nsILoadInfo* aLoadInfo,
+                                      nsIChannel** result)
 {
   if (mozilla::net::IsNeckoChild())
     mozilla::net::NeckoChild::InitNeckoChild();
 
   NS_ENSURE_ARG_POINTER(url);
   nsresult rv;
 
   nsCOMPtr<nsIWyciwygChannel> channel;
@@ -129,16 +131,22 @@ nsWyciwygProtocolHandler::NewChannel(nsI
   if (NS_FAILED(rv))
     return rv;
 
   channel.forget(result);
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsWyciwygProtocolHandler::NewChannel(nsIURI* url, nsIChannel* *result)
+{
+  return NewChannel2(url, nullptr, result);
+}
+
+NS_IMETHODIMP
 nsWyciwygProtocolHandler::GetProtocolFlags(uint32_t *result) 
 {
   // Should this be an an nsINestedURI?  We don't really want random webpages
   // loading these URIs...
 
   // Note that using URI_INHERITS_SECURITY_CONTEXT here is OK -- untrusted code
   // is not allowed to link to wyciwyg URIs and users shouldn't be able to get
   // at them, and nsDocShell::InternalLoad forbids non-history loads of these
--- a/toolkit/components/places/nsAnnoProtocolHandler.cpp
+++ b/toolkit/components/places/nsAnnoProtocolHandler.cpp
@@ -258,33 +258,41 @@ nsAnnoProtocolHandler::NewURI(const nsAC
   return NS_OK;
 }
 
 
 // nsAnnoProtocolHandler::NewChannel
 //
 
 NS_IMETHODIMP
-nsAnnoProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
+nsAnnoProtocolHandler::NewChannel2(nsIURI* aURI,
+                                   nsILoadInfo* aLoadInfo,
+                                   nsIChannel** _retval)
 {
   NS_ENSURE_ARG_POINTER(aURI);
 
   // annotation info
   nsCOMPtr<nsIURI> annoURI;
   nsAutoCString annoName;
   nsresult rv = ParseAnnoURI(aURI, getter_AddRefs(annoURI), annoName);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Only favicon annotation are supported.
   if (!annoName.EqualsLiteral(FAVICON_ANNOTATION_NAME))
     return NS_ERROR_INVALID_ARG;
 
   return NewFaviconChannel(aURI, annoURI, _retval);
 }
 
+NS_IMETHODIMP
+nsAnnoProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
+{
+  return NewChannel2(aURI, nullptr, _retval);
+}
+
 
 // nsAnnoProtocolHandler::AllowPort
 //
 //    Don't override any bans on bad ports.
 
 NS_IMETHODIMP
 nsAnnoProtocolHandler::AllowPort(int32_t port, const char *scheme,
                                  bool *_retval)
--- a/uriloader/exthandler/nsExternalProtocolHandler.cpp
+++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp
@@ -390,17 +390,20 @@ NS_IMETHODIMP nsExternalProtocolHandler:
   
   rv = uri->SetSpec(aSpec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_ADDREF(*_retval = uri);
   return NS_OK;
 }
 
-NS_IMETHODIMP nsExternalProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
+NS_IMETHODIMP
+nsExternalProtocolHandler::NewChannel2(nsIURI* aURI,
+                                       nsILoadInfo* aLoadInfo,
+                                       nsIChannel** _retval)
 {
   // Only try to return a channel if we have a protocol handler for the url.
   // nsOSHelperAppService::LoadUriInternal relies on this to check trustedness
   // for some platforms at least.  (win uses ::ShellExecute and unix uses
   // gnome_url_show.)
   bool haveExternalHandler = HaveExternalProtocolHandler(aURI);
   if (haveExternalHandler)
   {
@@ -416,16 +419,21 @@ NS_IMETHODIMP nsExternalProtocolHandler:
       NS_IF_ADDREF(*_retval);
       return NS_OK;
     }
   }
 
   return NS_ERROR_UNKNOWN_PROTOCOL;
 }
 
+NS_IMETHODIMP nsExternalProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
+{
+  return NewChannel2(aURI, nullptr, _retval);
+}
+
 ///////////////////////////////////////////////////////////////////////
 // External protocol handler interface implementation
 //////////////////////////////////////////////////////////////////////
 NS_IMETHODIMP nsExternalProtocolHandler::ExternalAppExistsForScheme(const nsACString& aScheme, bool *_retval)
 {
   nsCOMPtr<nsIExternalProtocolService> extProtSvc(do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID));
   if (extProtSvc)
     return extProtSvc->ExternalProtocolHandlerExists(
--- a/widget/android/nsAndroidProtocolHandler.cpp
+++ b/widget/android/nsAndroidProtocolHandler.cpp
@@ -158,17 +158,25 @@ nsAndroidProtocolHandler::NewURI(const n
 
     surl->SetMutable(false);
 
     NS_ADDREF(*result = url);
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAndroidProtocolHandler::NewChannel(nsIURI* aURI,
-                                     nsIChannel* *aResult)
+nsAndroidProtocolHandler::NewChannel2(nsIURI* aURI,
+                                      nsILoadInfo* aLoadInfo,
+                                      nsIChannel** aResult)
 {
     nsCOMPtr<nsIChannel> channel = AndroidChannel::CreateChannel(aURI);
     if (!channel)
         return NS_ERROR_FAILURE;
     NS_ADDREF(*aResult = channel);
     return NS_OK;
 }
+
+NS_IMETHODIMP
+nsAndroidProtocolHandler::NewChannel(nsIURI* aURI,
+                                     nsIChannel* *aResult)
+{
+    return NewChannel2(aURI, nullptr, aResult);
+}