Bug 1407679 - Merge nsIIOService and nsIIOService2 r=nwgh
☠☠ backed out by 2f41083748ae ☠ ☠
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 20 Oct 2017 16:41:07 +0200
changeset 685801 dab1c5badddbf3dafd34b52700c3e1129f76d632
parent 685800 61e69d3a6cf72e2750211a156a6168b7f9149ba1
child 685802 b3dcf61084abe620b3f29df70055fdeeeb36f0d0
push id86016
push userkgupta@mozilla.com
push dateWed, 25 Oct 2017 01:53:44 +0000
reviewersnwgh
bugs1407679
milestone58.0a1
Bug 1407679 - Merge nsIIOService and nsIIOService2 r=nwgh Removes deprecated nsIIOService2.newChannelFromURIWithProxyFlags MozReview-Commit-ID: Gr3nA25kcre
dom/events/test/test_bug336682.js
dom/workers/test/test_onLine.html
layout/tools/reftest/bootstrap.js
mobile/android/tests/browser/robocop/robocop_head.js
netwerk/base/moz.build
netwerk/base/nsIIOService.idl
netwerk/base/nsIIOService2.idl
netwerk/base/nsIOService.cpp
netwerk/base/nsIOService.h
netwerk/build/nsNetCID.h
netwerk/protocol/websocket/WebSocketChannel.cpp
netwerk/test/unit/test_bug1177909.js
services/sync/tps/extensions/tps/components/tps-cmdline.js
testing/mochitest/server.js
testing/xpcshell/head.js
toolkit/modules/Services.jsm
toolkit/modules/tests/xpcshell/test_Services.js
toolkit/mozapps/update/tests/chrome/update.sjs
toolkit/xre/nsAppRunner.cpp
tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-services.js
--- a/dom/events/test/test_bug336682.js
+++ b/dom/events/test/test_bug336682.js
@@ -60,17 +60,17 @@ function makeHandler(nameTemplate, event
     ok(e.target == (document instanceof HTMLDocument
                     ? document.body : document.documentElement),
        "the event target should be the body element");
   }
 }
 
 function doTest() {
   var iosvc = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
-                           .getService(SpecialPowers.Ci.nsIIOService2);
+                           .getService(SpecialPowers.Ci.nsIIOService);
   iosvc.manageOfflineStatus = false;
   iosvc.offline = false;
   ok(navigator.onLine, "navigator.onLine should be true, since we've just " +
                        "set nsIIOService.offline to false");
 
   gState = 0;
 
   trace("setting iosvc.offline = true");
--- a/dom/workers/test/test_onLine.html
+++ b/dom/workers/test/test_onLine.html
@@ -40,17 +40,17 @@ addLoadEvent(function() {
       ok(e.data.test, e.data.message);
     } else if (e.data.type === 'finished') {
       SimpleTest.finish();
     }
   }
 
   function doTest() {
     var iosvc = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
-                             .getService(SpecialPowers.Ci.nsIIOService2);
+                             .getService(SpecialPowers.Ci.nsIIOService);
     iosvc.manageOfflineStatus = false;
 
     info("setting iosvc.offline = true");
     iosvc.offline = true;
 
     info("setting iosvc.offline = false");
     iosvc.offline = false;
 
--- a/layout/tools/reftest/bootstrap.js
+++ b/layout/tools/reftest/bootstrap.js
@@ -34,17 +34,17 @@ function startup(data, reason) {
     Cm.addBootstrappedManifestLocation(data.installPath);
     Services.wm.addListener(WindowListener);
     return;
   }
 
   let orig = Services.wm.getMostRecentWindow("navigator:browser");
 
   let ios = Cc["@mozilla.org/network/io-service;1"]
-            .getService(Ci.nsIIOService2);
+              .getService(Ci.nsIIOService);
   ios.manageOfflineStatus = false;
   ios.offline = false;
 
   let wwatch = Cc["@mozilla.org/embedcomp/window-watcher;1"]
                 .getService(Ci.nsIWindowWatcher);
   let dummy = wwatch.openWindow(null, "about:blank", "dummy",
                                 "chrome,dialog=no,left=800,height=200,width=200,all",null);
   dummy.onload = function() {
--- a/mobile/android/tests/browser/robocop/robocop_head.js
+++ b/mobile/android/tests/browser/robocop/robocop_head.js
@@ -33,17 +33,17 @@ function _dump(str) {
   let start = /^TEST-/.test(str) ? "\n" : "";
   dump(start + str);
 }
 
 // Disable automatic network detection, so tests work correctly when
 // not connected to a network.
 {
   let ios = Components.classes["@mozilla.org/network/io-service;1"]
-             .getService(Components.interfaces.nsIIOService2);
+                      .getService(Components.interfaces.nsIIOService);
   ios.manageOfflineStatus = false;
   ios.offline = false;
 }
 
 // Determine if we're running on parent or child
 var runningInParent = true;
 try {
   runningInParent = Components.classes["@mozilla.org/xre/runtime;1"].
--- a/netwerk/base/moz.build
+++ b/netwerk/base/moz.build
@@ -48,17 +48,16 @@ XPIDL_SOURCES += [
     'nsIFormPOSTActionChannel.idl',
     'nsIHttpAuthenticatorCallback.idl',
     'nsIHttpPushListener.idl',
     'nsIIncrementalDownload.idl',
     'nsIIncrementalStreamLoader.idl',
     'nsIInputStreamChannel.idl',
     'nsIInputStreamPump.idl',
     'nsIIOService.idl',
-    'nsIIOService2.idl',
     'nsILoadContextInfo.idl',
     'nsILoadGroup.idl',
     'nsILoadGroupChild.idl',
     'nsILoadInfo.idl',
     'nsIMIMEInputStream.idl',
     'nsIMultiPartChannel.idl',
     'nsINestedURI.idl',
     'nsINetAddr.idl',
--- a/netwerk/base/nsIIOService.idl
+++ b/netwerk/base/nsIIOService.idl
@@ -179,16 +179,62 @@ interface nsIIOService : nsISupports
 
     /**
      * Checks if a URI host is a local IPv4 or IPv6 address literal.
      *
      * @param nsIURI the URI that contains the hostname to check
      * @return true if the URI hostname is a local IP address
      */
     boolean hostnameIsLocalIPAddress(in nsIURI aURI);
+
+    /**
+     * While this is set, IOService will monitor an nsINetworkLinkService
+     * (if available) and set its offline status to "true" whenever
+     * isLinkUp is false.
+     *
+     * Applications that want to control changes to the IOService's offline
+     * status should set this to false, watch for network:link-status-changed
+     * broadcasts, and change nsIIOService::offline as they see fit. Note
+     * that this means during application startup, IOService may be offline
+     * if there is no link, until application code runs and can turn off
+     * this management.
+     */
+    attribute boolean manageOfflineStatus;
+
+    /**
+     * 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
+     * @param aLoadingNode
+     * @param aLoadingPrincipal
+     * @param aTriggeringPrincipal
+     * @param aSecurityFlags
+     * @param aContentPolicyType
+     *        These will be used as values for the nsILoadInfo object on the
+     *        created channel. For details, see nsILoadInfo in nsILoadInfo.idl
+     * @return reference to the new nsIChannel object
+     *
+     * Please note, if you provide both a loadingNode and a loadingPrincipal,
+     * then loadingPrincipal must be equal to loadingNode->NodePrincipal().
+     * But less error prone is to just supply a loadingNode.
+     */
+    nsIChannel newChannelFromURIWithProxyFlags2(in nsIURI aURI,
+                                                in nsIURI aProxyURI,
+                                                in unsigned long aProxyFlags,
+                                                in nsIDOMNode aLoadingNode,
+                                                in nsIPrincipal aLoadingPrincipal,
+                                                in nsIPrincipal aTriggeringPrincipal,
+                                                in unsigned long aSecurityFlags,
+                                                in unsigned long aContentPolicyType);
 };
 
 %{C++
 /**
  * We send notifications through nsIObserverService with topic
  * NS_IOSERVICE_GOING_OFFLINE_TOPIC and data NS_IOSERVICE_OFFLINE
  * when 'offline' has changed from false to true, and we are about
  * to shut down network services such as DNS. When those
deleted file mode 100644
--- a/netwerk/base/nsIIOService2.idl
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim:expandtab:shiftwidth=4:tabstop=4:
- */
-/* 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 "nsIIOService.idl"
-
-interface nsIDOMNode;
-interface nsIPrincipal;
-
-/**
- * nsIIOService2 extends nsIIOService
- */
-[scriptable, uuid(52c5804b-0d3c-4d4f-8654-1c36fd310e69)]
-interface nsIIOService2 : nsIIOService
-{
-  /**
-   * While this is set, IOService will monitor an nsINetworkLinkService
-   * (if available) and set its offline status to "true" whenever
-   * isLinkUp is false.
-   *
-   * Applications that want to control changes to the IOService's offline
-   * status should set this to false, watch for network:link-status-changed
-   * broadcasts, and change nsIIOService::offline as they see fit. Note
-   * that this means during application startup, IOService may be offline
-   * if there is no link, until application code runs and can turn off
-   * this management.
-   */
-  attribute boolean manageOfflineStatus;
-
-  /**
-   * 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
-   * @param aLoadingNode
-   * @param aLoadingPrincipal
-   * @param aTriggeringPrincipal
-   * @param aSecurityFlags
-   * @param aContentPolicyType
-   *        These will be used as values for the nsILoadInfo object on the
-   *        created channel. For details, see nsILoadInfo in nsILoadInfo.idl
-   * @return reference to the new nsIChannel object
-   *
-   * Please note, if you provide both a loadingNode and a loadingPrincipal,
-   * then loadingPrincipal must be equal to loadingNode->NodePrincipal().
-   * But less error prone is to just supply a loadingNode.
-   */
-  nsIChannel newChannelFromURIWithProxyFlags2(in nsIURI aURI,
-                                              in nsIURI aProxyURI,
-                                              in unsigned long aProxyFlags,
-                                              in nsIDOMNode aLoadingNode,
-                                              in nsIPrincipal aLoadingPrincipal,
-                                              in nsIPrincipal aTriggeringPrincipal,
-                                              in unsigned long aSecurityFlags,
-                                              in unsigned long aContentPolicyType);
-
-  /**
-   * ***** DEPRECATED *****
-   * Please use newChannelFromURIWithProxyFlags2()
-   *
-   * 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
@@ -367,17 +367,16 @@ nsIOService::GetInstance() {
         return gIOService;
     }
     NS_ADDREF(gIOService);
     return gIOService;
 }
 
 NS_IMPL_ISUPPORTS(nsIOService,
                   nsIIOService,
-                  nsIIOService2,
                   nsINetUtil,
                   nsISpeculativeConnect,
                   nsIObserver,
                   nsIIOServiceInternal,
                   nsISupportsWeakReference)
 
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -940,56 +939,16 @@ 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!");
-
-  const char16_t* params[] = {
-    u"nsIOService::NewChannelFromURIWithProxyFlags()",
-    u"nsIOService::NewChannelFromURIWithProxyFlags2()"
-  };
-  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
-                                  NS_LITERAL_CSTRING("Security by Default"),
-                                  nullptr, // aDocument
-                                  nsContentUtils::eNECKO_PROPERTIES,
-                                  "APIDeprecationWarning",
-                                  params, ArrayLength(params));
-
-  return NewChannelFromURIWithProxyFlags2(aURI,
-                                          aProxyURI,
-                                          aProxyFlags,
-                                          nullptr, // aLoadingNode
-                                          nsContentUtils::GetSystemPrincipal(),
-                                          nullptr, // aTriggeringPrincipal
-                                          nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
-                                          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,
--- a/netwerk/base/nsIOService.h
+++ b/netwerk/base/nsIOService.h
@@ -2,17 +2,17 @@
 /* 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/. */
 
 #ifndef nsIOService_h__
 #define nsIOService_h__
 
 #include "nsStringFwd.h"
-#include "nsIIOService2.h"
+#include "nsIIOService.h"
 #include "nsTArray.h"
 #include "nsCOMPtr.h"
 #include "nsWeakPtr.h"
 #include "nsIObserver.h"
 #include "nsWeakReference.h"
 #include "nsINetUtil.h"
 #include "nsIChannelEventSink.h"
 #include "nsCategoryCache.h"
@@ -41,27 +41,26 @@ class nsIProxyInfo;
 class nsPIDNSService;
 class nsPISocketTransportService;
 
 namespace mozilla {
 namespace net {
 class NeckoChild;
 class nsAsyncRedirectVerifyHelper;
 
-class nsIOService final : public nsIIOService2
+class nsIOService final : public nsIIOService
                         , public nsIObserver
                         , public nsINetUtil
                         , public nsISpeculativeConnect
                         , public nsSupportsWeakReference
                         , public nsIIOServiceInternal
 {
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIIOSERVICE
-    NS_DECL_NSIIOSERVICE2
     NS_DECL_NSIOBSERVER
     NS_DECL_NSINETUTIL
     NS_DECL_NSISPECULATIVECONNECT
     NS_DECL_NSIIOSERVICEINTERNAL
 
     // Gets the singleton instance of the IO Service, creating it as needed
     // Returns nullptr on out of memory or failure to initialize.
     // Returns an addrefed pointer.
--- a/netwerk/build/nsNetCID.h
+++ b/netwerk/build/nsNetCID.h
@@ -6,17 +6,17 @@
 #ifndef nsNetCID_h__
 #define nsNetCID_h__
 
 
 /******************************************************************************
  * netwerk/base/ classes
  */
 
-// service implementing nsIIOService and nsIIOService2.
+// service implementing nsIIOService
 #define NS_IOSERVICE_CONTRACTID \
     "@mozilla.org/network/io-service;1"
 #define NS_IOSERVICE_CID                             \
 { /* 9ac9e770-18bc-11d3-9337-00104ba0fd40 */         \
     0x9ac9e770,                                      \
     0x18bc,                                          \
     0x11d3,                                          \
     {0x93, 0x37, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -20,17 +20,17 @@
 #include "nsIRunnable.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsICancelable.h"
 #include "nsIClassOfService.h"
 #include "nsIDNSRecord.h"
 #include "nsIDNSService.h"
 #include "nsIStreamConverterService.h"
-#include "nsIIOService2.h"
+#include "nsIIOService.h"
 #include "nsIProtocolProxyService.h"
 #include "nsIProxyInfo.h"
 #include "nsIProxiedChannel.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIDashboardEventNotifier.h"
 #include "nsIEventTarget.h"
 #include "nsIHttpChannel.h"
 #include "nsILoadGroup.h"
@@ -3470,25 +3470,19 @@ WebSocketChannel::AsyncOpen(nsIURI *aURI
 
   nsCOMPtr<nsIIOService> ioService;
   ioService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     NS_WARNING("unable to continue without io service");
     return rv;
   }
 
-  nsCOMPtr<nsIIOService2> io2 = do_QueryInterface(ioService, &rv);
-  if (NS_FAILED(rv)) {
-    NS_WARNING("WebSocketChannel: unable to continue without ioservice2");
-    return rv;
-  }
-
   // Ideally we'd call newChannelFromURIWithLoadInfo here, but that doesn't
   // allow setting proxy uri/flags
-  rv = io2->NewChannelFromURIWithProxyFlags2(
+  rv = ioService->NewChannelFromURIWithProxyFlags2(
               localURI,
               mURI,
               nsIProtocolProxyService::RESOLVE_PREFER_HTTPS_PROXY |
               nsIProtocolProxyService::RESOLVE_ALWAYS_TUNNEL,
               mLoadInfo->LoadingNode() ?
                 mLoadInfo->LoadingNode()->AsDOMNode() : nullptr,
               mLoadInfo->LoadingPrincipal(),
               mLoadInfo->TriggeringPrincipal(),
--- a/netwerk/test/unit/test_bug1177909.js
+++ b/netwerk/test/unit/test_bug1177909.js
@@ -100,17 +100,17 @@ add_task(async function testSocksProxy()
 add_task(async function testDirectProxy() {
   // Do what |WebSocketChannel::AsyncOpen| do, but do not prefer https proxy.
   let proxyURI = Cc["@mozilla.org/network/standard-url;1"].createInstance(Ci.nsIURI);
   proxyURI.spec = "wss://ws.mozilla.org/";
   let uri = proxyURI.clone();
   uri.scheme = "https";
 
   let ioService = Cc["@mozilla.org/network/io-service;1"].
-                  getService(Ci.nsIIOService2);
+                    getService(Ci.nsIIOService);
   let chan = ioService.
     newChannelFromURIWithProxyFlags2(uri,
                                      proxyURI,
                                      0,
                                      null,
                                      Services.scriptSecurityManager.getSystemPrincipal(),
                                      null,
                                      Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
@@ -126,17 +126,17 @@ add_task(async function testWebSocketPro
   proxyURI.spec = "wss://ws.mozilla.org/";
   let uri = proxyURI.clone();
   uri.scheme = "https";
 
   let proxyFlags = Ci.nsIProtocolProxyService.RESOLVE_PREFER_HTTPS_PROXY |
                    Ci.nsIProtocolProxyService.RESOLVE_ALWAYS_TUNNEL;
 
   let ioService = Cc["@mozilla.org/network/io-service;1"].
-                  getService(Ci.nsIIOService2);
+                    getService(Ci.nsIIOService);
   let chan = ioService.
     newChannelFromURIWithProxyFlags2(uri,
                                      proxyURI,
                                      proxyFlags,
                                      null,
                                      Services.scriptSecurityManager.getSystemPrincipal(),
                                      null,
                                      Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
--- a/services/sync/tps/extensions/tps/components/tps-cmdline.js
+++ b/services/sync/tps/extensions/tps/components/tps-cmdline.js
@@ -59,17 +59,17 @@ TPSCmdLineHandler.prototype = {
     options.ignoreUnusedEngines = cmdLine.handleFlag("ignore-unused-engines",
                                                      false);
     let uri = cmdLine.resolveURI(OS.Path.normalize(uristr)).spec;
 
     const onStartupFinished = () => {
       Services.obs.removeObserver(onStartupFinished, "browser-delayed-startup-finished");
       /* Ignore the platform's online/offline status while running tests. */
       var ios = Components.classes["@mozilla.org/network/io-service;1"]
-                .getService(Components.interfaces.nsIIOService2);
+                          .getService(Components.interfaces.nsIIOService);
       ios.manageOfflineStatus = false;
       ios.offline = false;
       Components.utils.import("resource://tps/tps.jsm");
       Components.utils.import("resource://tps/quit.js", TPS);
       TPS.RunTestPhase(uri, phase, logfile, options).catch(err => TPS.DumpError("TestPhase failed", err));
     };
     Services.obs.addObserver(onStartupFinished, "browser-delayed-startup-finished");
   },
--- a/testing/mochitest/server.js
+++ b/testing/mochitest/server.js
@@ -6,17 +6,17 @@
 
 // Note that the server script itself already defines Cc, Ci, and Cr for us,
 // and because they're constants it's not safe to redefine them.  Scope leakage
 // sucks.
 
 // Disable automatic network detection, so tests work correctly when
 // not connected to a network.
 var ios = Cc["@mozilla.org/network/io-service;1"]
-          .getService(Ci.nsIIOService2);
+            .getService(Ci.nsIIOService);
 ios.manageOfflineStatus = false;
 ios.offline = false;
 
 var server; // for use in the shutdown handler, if necessary
 
 //
 // HTML GENERATION
 //
--- a/testing/xpcshell/head.js
+++ b/testing/xpcshell/head.js
@@ -65,17 +65,17 @@ var _dumpLog = function(raw_msg) {
 
 var _LoggerClass = Components.utils.import("resource://testing-common/StructuredLog.jsm", null).StructuredLogger;
 var _testLogger = new _LoggerClass("xpcshell/head.js", _dumpLog, [_add_params]);
 
 // Disable automatic network detection, so tests work correctly when
 // not connected to a network.
 {
   let ios = Components.classes["@mozilla.org/network/io-service;1"]
-                      .getService(Components.interfaces.nsIIOService2);
+                      .getService(Components.interfaces.nsIIOService);
   ios.manageOfflineStatus = false;
   ios.offline = false;
 }
 
 // Determine if we're running on parent or child
 var runningInParent = true;
 try {
   runningInParent = Components.classes["@mozilla.org/xre/runtime;1"].
--- a/toolkit/modules/Services.jsm
+++ b/toolkit/modules/Services.jsm
@@ -62,17 +62,17 @@ XPCOMUtils.defineLazyGetter(Services, "m
 XPCOMUtils.defineLazyGetter(Services, "ppmm", () => {
   return Cc["@mozilla.org/parentprocessmessagemanager;1"]
            .getService(Ci.nsIMessageBroadcaster)
            .QueryInterface(Ci.nsIProcessScriptLoader);
 });
 
 XPCOMUtils.defineLazyGetter(Services, "io", () => {
   return Cc["@mozilla.org/network/io-service;1"]
-           .getService(Ci.nsIIOService2)
+           .getService(Ci.nsIIOService)
            .QueryInterface(Ci.nsISpeculativeConnect);
 });
 
 var initTable = {
   appShell: ["@mozilla.org/appshell/appShellService;1", "nsIAppShellService"],
   cache: ["@mozilla.org/network/cache-service;1", "nsICacheService"],
   cache2: ["@mozilla.org/netwerk/cache-storage-service;1", "nsICacheStorageService"],
   cpmm: ["@mozilla.org/childprocessmessagemanager;1", "nsIMessageSender"],
--- a/toolkit/modules/tests/xpcshell/test_Services.js
+++ b/toolkit/modules/tests/xpcshell/test_Services.js
@@ -38,17 +38,16 @@ function run_test() {
   checkService("dirsvc", Ci.nsIProperties);
   checkService("DOMRequest", Ci.nsIDOMRequestService);
   checkService("domStorageManager", Ci.nsIDOMStorageManager);
   checkService("downloads", Ci.nsIDownloadManager);
   checkService("droppedLinkHandler", Ci.nsIDroppedLinkHandler);
   checkService("eTLD", Ci.nsIEffectiveTLDService);
   checkService("focus", Ci.nsIFocusManager);
   checkService("io", Ci.nsIIOService);
-  checkService("io", Ci.nsIIOService2);
   checkService("intl", Ci.mozIMozIntl);
   checkService("locale", Ci.mozILocaleService);
   checkService("logins", Ci.nsILoginManager);
   checkService("obs", Ci.nsIObserverService);
   checkService("perms", Ci.nsIPermissionManager);
   checkService("prefs", Ci.nsIPrefBranch);
   checkService("prefs", Ci.nsIPrefService);
   checkService("prompt", Ci.nsIPromptService);
--- a/toolkit/mozapps/update/tests/chrome/update.sjs
+++ b/toolkit/mozapps/update/tests/chrome/update.sjs
@@ -17,17 +17,17 @@ function getTestDataFile(aFilename) {
   }
   if (aFilename) {
     file.append(aFilename);
   }
   return file;
 }
 
 function loadHelperScript(aScriptFile) {
-  let io = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService2);
+  let io = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
   let scriptSpec = io.newFileURI(aScriptFile).spec;
   let scriptloader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
                      getService(Ci.mozIJSSubScriptLoader);
   scriptloader.loadSubScript(scriptSpec, this);
 }
 
 var scriptFile = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
 scriptFile.initWithPath(getState("__LOCATION__"));
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -58,17 +58,17 @@
 #include "nsICommandLineRunner.h"
 #include "nsIComponentManager.h"
 #include "nsIComponentRegistrar.h"
 #include "nsIConsoleService.h"
 #include "nsIContentHandler.h"
 #include "nsIDialogParamBlock.h"
 #include "nsIDOMWindow.h"
 #include "mozilla/ModuleUtils.h"
-#include "nsIIOService2.h"
+#include "nsIIOService.h"
 #include "nsIObserverService.h"
 #include "nsINativeAppSupport.h"
 #include "nsIPlatformInfo.h"
 #include "nsIProcess.h"
 #include "nsIProfileUnlocker.h"
 #include "nsIPromptService.h"
 #include "nsIServiceManager.h"
 #include "nsIStringBundle.h"
@@ -4385,17 +4385,17 @@ XREMain::XRE_mainRun()
 #if defined(XP_LINUX) && !defined(ANDROID)
   PR_CreateThread(PR_USER_THREAD, AnnotateLSBRelease, 0, PR_PRIORITY_LOW,
                   PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0);
 #endif
 
 #endif
 
   if (mStartOffline) {
-    nsCOMPtr<nsIIOService2> io (do_GetService("@mozilla.org/network/io-service;1"));
+    nsCOMPtr<nsIIOService> io(do_GetService("@mozilla.org/network/io-service;1"));
     NS_ENSURE_TRUE(io, NS_ERROR_FAILURE);
     io->SetManageOfflineStatus(false);
     io->SetOffline(true);
   }
 
 
 #ifdef XP_WIN
   if (!PR_GetEnv("XRE_NO_DLL_READAHEAD"))
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-services.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-services.js
@@ -26,17 +26,16 @@ var servicesASTParser = {
     "nsIPrefService": "prefs",
     "nsIXULRuntime": "appInfo",
     "nsIXULAppInfo": "appInfo",
     "nsIDirectoryService": "dirsvc",
     "nsIProperties": "dirsvc",
     "nsIFrameScriptLoader": "mm",
     "nsIProcessScriptLoader": "ppmm",
     "nsIIOService": "io",
-    "nsIIOService2": "io",
     "nsISpeculativeConnect": "io",
     // Bug 1407720 - Services lists nsICookieManager2, but that inherits directly
     // from nsICookieManager, so we have to list it separately.
     "nsICookieManager": "cookies"
   },
 
   /**
    * This looks for any global variable declarations that are being initialised