Backed out changeset 65051cc8fc06 (bug 1254752) for browser_dbg_addon-sources.js failures
authorWes Kocher <wkocher@mozilla.com>
Wed, 09 Mar 2016 10:56:28 -0800
changeset 287519 c9218e5c95d3a29413d0ee4cd93ada1b86a6e009
parent 287518 e26f9e5f41cd58d934a00719ca2646ddc1fa4964
child 287520 079e85fe0e4d6271bd38ea6966950afd1b425b4c
push id73207
push userkwierso@gmail.com
push dateWed, 09 Mar 2016 18:57:33 +0000
treeherdermozilla-inbound@c9218e5c95d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1254752
milestone48.0a1
backs out65051cc8fc06c0ab2287da988191563598b89a18
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
Backed out changeset 65051cc8fc06 (bug 1254752) for browser_dbg_addon-sources.js failures MozReview-Commit-ID: 8Lg5gJHY6J5
dom/plugins/base/nsPluginHost.cpp
netwerk/base/nsIIOService.idl
netwerk/base/nsIIOService2.idl
netwerk/base/nsIOService.cpp
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -635,30 +635,25 @@ nsresult nsPluginHost::FindProxyForURL(c
   if (NS_FAILED(res) || !proxyService)
     return res;
 
   RefPtr<nsProtocolProxyService> rawProxyService = do_QueryObject(proxyService);
   if (!rawProxyService) {
     return NS_ERROR_FAILURE;
   }
 
+  nsCOMPtr<nsIIOService> ioService = do_GetService(NS_IOSERVICE_CONTRACTID, &res);
+  if (NS_FAILED(res) || !ioService)
+    return res;
+
   // make a temporary channel from the argument url
-  nsCOMPtr<nsIURI> uri;
-  res = NS_NewURI(getter_AddRefs(uri), nsDependentCString(url));
-  NS_ENSURE_SUCCESS(res, res);
-
-  nsCOMPtr<nsIPrincipal> nullPrincipal = nsNullPrincipal::Create();
-  NS_ENSURE_TRUE(nullPrincipal, NS_ERROR_FAILURE);
-  // The following channel is never openend, so it does not matter what
-  // securityFlags we pass; let's follow the principle of least privilege.
   nsCOMPtr<nsIChannel> tempChannel;
-  res = NS_NewChannel(getter_AddRefs(tempChannel), uri, nullPrincipal,
-                      nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
-                      nsIContentPolicy::TYPE_OTHER);
-  NS_ENSURE_SUCCESS(res, res);
+  res = ioService->NewChannel(nsDependentCString(url), nullptr, nullptr, getter_AddRefs(tempChannel));
+  if (NS_FAILED(res))
+    return res;
 
   nsCOMPtr<nsIProxyInfo> pi;
 
   // Remove this deprecated call in the future (see Bug 778201):
   res = rawProxyService->DeprecatedBlockingResolve(tempChannel, 0, getter_AddRefs(pi));
   if (NS_FAILED(res))
     return res;
 
--- a/netwerk/base/nsIIOService.idl
+++ b/netwerk/base/nsIIOService.idl
@@ -136,28 +136,43 @@ interface nsIIOService : nsISupports
 
     /**
      * Equivalent to newChannelFromURI2(aURI, aLoadingNode, ...)
      */
     nsIChannel newChannelFromURIWithLoadInfo(in nsIURI aURI,
                                              in nsILoadInfo aLoadInfo);
 
     /**
+     * Creates a channel for a given URI.
+     *
+     * @param aURI nsIURI from which to make a channel
+     * @return reference to the new nsIChannel object
+     */
+    nsIChannel newChannelFromURI(in nsIURI aURI);
+
+    /**
      * Equivalent to newChannelFromURI2(newURI(...))
      */
     nsIChannel newChannel2(in AUTF8String aSpec,
                            in string aOriginCharset,
                            in nsIURI aBaseURI,
                            in nsIDOMNode aLoadingNode,
                            in nsIPrincipal aLoadingPrincipal,
                            in nsIPrincipal aTriggeringPrincipal,
                            in unsigned long aSecurityFlags,
                            in unsigned long aContentPolicyType);
 
     /**
+     * Equivalent to newChannelFromURI(newURI(...))
+     */
+    nsIChannel newChannel(in AUTF8String aSpec,
+                          in string aOriginCharset,
+                          in nsIURI aBaseURI);
+
+    /**
      * Returns true if networking is in "offline" mode. When in offline mode, 
      * attempts to access the network will fail (although this does not 
      * necessarily correlate with whether there is actually a network 
      * available -- that's hard to detect without causing the dialer to 
      * come up).
      *
      * Changing this fires observer notifications ... see below.
      */
--- a/netwerk/base/nsIIOService2.idl
+++ b/netwerk/base/nsIIOService2.idl
@@ -98,9 +98,22 @@ interface nsIIOService2 : nsIIOService
                                               in nsIURI aProxyURI,
                                               in unsigned long aProxyFlags,
                                               in nsIDOMNode aLoadingNode,
                                               in nsIPrincipal aLoadingPrincipal,
                                               in nsIPrincipal aTriggeringPrincipal,
                                               in unsigned long aSecurityFlags,
                                               in unsigned long aContentPolicyType);
 
+  /**
+   * Creates a channel for a given URI.
+   *
+   * @param aURI nsIURI from which to make a channel
+   * @param aProxyURI nsIURI to use for proxy resolution. Can be null in which
+   *        case aURI is used
+   * @param aProxyFlags flags from nsIProtocolProxyService to use
+   *        when resolving proxies for this new channel
+   * @return reference to the new nsIChannel object
+   */
+  nsIChannel newChannelFromURIWithProxyFlags(in nsIURI aURI,
+                                             in nsIURI aProxyURI,
+                                             in unsigned long aProxyFlags);
 };
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -669,16 +669,39 @@ nsIOService::NewChannelFromURIWithLoadIn
 {
   return NewChannelFromURIWithProxyFlagsInternal(aURI,
                                                  nullptr, // aProxyURI
                                                  0,       // aProxyFlags
                                                  aLoadInfo,
                                                  result);
 }
 
+/*  ***** DEPRECATED *****
+ * please use NewChannelFromURI2 providing the right arguments for:
+ *        * aLoadingNode
+ *        * aLoadingPrincipal
+ *        * aTriggeringPrincipal
+ *        * aSecurityFlags
+ *        * aContentPolicyType
+ *
+ * See nsIIoService.idl for a detailed description of those arguments
+ */
+NS_IMETHODIMP
+nsIOService::NewChannelFromURI(nsIURI *aURI, nsIChannel **result)
+{
+  NS_ASSERTION(false, "Deprecated, use NewChannelFromURI2 providing loadInfo arguments!");
+  return NewChannelFromURI2(aURI,
+                            nullptr, // aLoadingNode
+                            nullptr, // aLoadingPrincipal
+                            nullptr, // aTriggeringPrincipal
+                            nsILoadInfo::SEC_NORMAL,
+                            nsIContentPolicy::TYPE_OTHER,
+                            result);
+}
+
 nsresult
 nsIOService::NewChannelFromURIWithProxyFlagsInternal(nsIURI* aURI,
                                                      nsIURI* aProxyURI,
                                                      uint32_t aProxyFlags,
                                                      nsILoadInfo* aLoadInfo,
                                                      nsIChannel** result)
 {
     nsresult rv;
@@ -836,16 +859,44 @@ nsIOService::NewChannelFromURIWithProxyF
     NS_ASSERTION(loadInfo, "Please pass security info when creating a channel");
     return NewChannelFromURIWithProxyFlagsInternal(aURI,
                                                    aProxyURI,
                                                    aProxyFlags,
                                                    loadInfo,
                                                    result);
 }
 
+/*  ***** DEPRECATED *****
+ * please use NewChannelFromURIWithProxyFlags2 providing the right arguments for:
+ *        * aLoadingNode
+ *        * aLoadingPrincipal
+ *        * aTriggeringPrincipal
+ *        * aSecurityFlags
+ *        * aContentPolicyType
+ *
+ * See nsIIoService.idl for a detailed description of those arguments
+ */
+NS_IMETHODIMP
+nsIOService::NewChannelFromURIWithProxyFlags(nsIURI *aURI,
+                                             nsIURI *aProxyURI,
+                                             uint32_t aProxyFlags,
+                                             nsIChannel **result)
+{
+  NS_ASSERTION(false, "Deprecated, use NewChannelFromURIWithProxyFlags2 providing loadInfo arguments!");
+  return NewChannelFromURIWithProxyFlags2(aURI,
+                                          aProxyURI,
+                                          aProxyFlags,
+                                          nullptr, // aLoadingNode
+                                          nullptr, // aLoadingPrincipal
+                                          nullptr, // aTriggeringPrincipal
+                                          nsILoadInfo::SEC_NORMAL,
+                                          nsIContentPolicy::TYPE_OTHER,
+                                          result);
+}
+
 NS_IMETHODIMP
 nsIOService::NewChannel2(const nsACString& aSpec,
                          const char* aCharset,
                          nsIURI* aBaseURI,
                          nsIDOMNode* aLoadingNode,
                          nsIPrincipal* aLoadingPrincipal,
                          nsIPrincipal* aTriggeringPrincipal,
                          uint32_t aSecurityFlags,
@@ -861,16 +912,41 @@ nsIOService::NewChannel2(const nsACStrin
                               aLoadingNode,
                               aLoadingPrincipal,
                               aTriggeringPrincipal,
                               aSecurityFlags,
                               aContentPolicyType,
                               result);
 }
 
+/*  ***** DEPRECATED *****
+ * please use NewChannel2 providing the right arguments for:
+ *        * aLoadingNode
+ *        * aLoadingPrincipal
+ *        * aTriggeringPrincipal
+ *        * aSecurityFlags
+ *        * aContentPolicyType
+ *
+ * See nsIIoService.idl for a detailed description of those arguments
+ */
+NS_IMETHODIMP
+nsIOService::NewChannel(const nsACString &aSpec, const char *aCharset, nsIURI *aBaseURI, nsIChannel **result)
+{
+  NS_ASSERTION(false, "Deprecated, use NewChannel2 providing loadInfo arguments!");
+  return NewChannel2(aSpec,
+                     aCharset,
+                     aBaseURI,
+                     nullptr, // aLoadingNode
+                     nullptr, // aLoadingPrincipal
+                     nullptr, // aTriggeringPrincipal
+                     nsILoadInfo::SEC_NORMAL,
+                     nsIContentPolicy::TYPE_OTHER,
+                     result);
+}
+
 bool
 nsIOService::IsLinkUp()
 {
     InitializeNetworkLinkService();
 
     if (!mNetworkLinkService) {
         // We cannot decide, assume the link is up
         return true;