Bug 973543 - Part 2: remove 'removeHostRoutes()' as it is no longer needed. r=echen
authorJessica Jong <jjong@mozilla.com>
Wed, 11 Feb 2015 16:01:10 +0800
changeset 255615 fe2b1047b5c803ae2f5513f275a755b70c121774
parent 255614 a75fca8e0b9df54bf671b6c9c096fb39fe33eb68
child 255616 84ddb2bacfc0ddde75161aad37009ce3690fabdd
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs973543
milestone38.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 973543 - Part 2: remove 'removeHostRoutes()' as it is no longer needed. r=echen
dom/system/gonk/NetworkService.js
dom/system/gonk/NetworkUtils.cpp
dom/system/gonk/NetworkUtils.h
dom/system/gonk/nsINetworkService.idl
--- a/dom/system/gonk/NetworkService.js
+++ b/dom/system/gonk/NetworkService.js
@@ -445,25 +445,16 @@ NetworkService.prototype = {
           this.addedRoutes.set(route, count ? count + 1 : 1);
         }
 
         aResolve();
       }, setupFunc);
     });
   },
 
-  removeHostRoutes: function(ifname) {
-    if(DEBUG) debug("Going to remove all host routes on " + ifname);
-    let options = {
-      cmd: "removeHostRoutes",
-      ifname: ifname,
-    };
-    this.controlMessage(options);
-  },
-
   addSecondaryRoute: function(ifname, route) {
     if(DEBUG) debug("Going to add route to secondary table on " + ifname);
     let options = {
       cmd: "addSecondaryRoute",
       ifname: ifname,
       ip: route.ip,
       prefix: route.prefix,
       gateway: route.gateway
--- a/dom/system/gonk/NetworkUtils.cpp
+++ b/dom/system/gonk/NetworkUtils.cpp
@@ -1480,17 +1480,16 @@ void NetworkUtils::ExecuteCommand(Networ
     #define BUILD_ENTRY(c) {#c, &NetworkUtils::c}
 
     BUILD_ENTRY(removeNetworkRoute),
     BUILD_ENTRY(setDNS),
     BUILD_ENTRY(setDefaultRoute),
     BUILD_ENTRY(removeDefaultRoute),
     BUILD_ENTRY(addHostRoute),
     BUILD_ENTRY(removeHostRoute),
-    BUILD_ENTRY(removeHostRoutes),
     BUILD_ENTRY(addSecondaryRoute),
     BUILD_ENTRY(removeSecondaryRoute),
     BUILD_ENTRY(setNetworkInterfaceAlarm),
     BUILD_ENTRY(enableNetworkInterfaceAlarm),
     BUILD_ENTRY(disableNetworkInterfaceAlarm),
     BUILD_ENTRY(setWifiOperationMode),
     BUILD_ENTRY(setDhcpServer),
     BUILD_ENTRY(setWifiTethering),
@@ -2026,37 +2025,16 @@ CommandResult NetworkUtils::removeHostRo
     return EINVAL;
   }
 
   prefix = type == AF_INET ? 32 : 128;
   return mNetUtils->do_ifc_remove_route(autoIfname.get(), autoHostname.get(),
                                         prefix, autoGateway.get());
 }
 
-/**
- * Remove the routes associated with the named interface.
- */
-CommandResult NetworkUtils::removeHostRoutes(NetworkParams& aOptions)
-{
-  if (SDK_VERSION < 20) {
-    return removeHostRoutesLegacy(aOptions);
-  }
-
-  NU_DBG("Don't know how to remove host routes on a interface");
-  return SUCCESS;
-}
-
-/**
- * Remove the routes associated with the named interface.
- */
-CommandResult NetworkUtils::removeHostRoutesLegacy(NetworkParams& aOptions)
-{
-  return mNetUtils->do_ifc_remove_host_routes(GET_CHAR(mIfname));
-}
-
 CommandResult NetworkUtils::removeNetworkRoute(NetworkParams& aOptions)
 {
   if (SDK_VERSION < 20) {
     return removeNetworkRouteLegacy(aOptions);
   }
 
   static CommandFunc COMMAND_CHAIN[] = {
     clearAddrForInterface,
--- a/dom/system/gonk/NetworkUtils.h
+++ b/dom/system/gonk/NetworkUtils.h
@@ -286,17 +286,16 @@ private:
   CommandResult dhcpRequest(NetworkParams& aOptions);
   CommandResult enableInterface(NetworkParams& aOptions);
   CommandResult disableInterface(NetworkParams& aOptions);
   CommandResult resetConnections(NetworkParams& aOptions);
   CommandResult setDefaultRoute(NetworkParams& aOptions);
   CommandResult addHostRoute(NetworkParams& aOptions);
   CommandResult removeDefaultRoute(NetworkParams& aOptions);
   CommandResult removeHostRoute(NetworkParams& aOptions);
-  CommandResult removeHostRoutes(NetworkParams& aOptions);
   CommandResult removeNetworkRoute(NetworkParams& aOptions);
   CommandResult setDNS(NetworkParams& aOptions);
   CommandResult addSecondaryRoute(NetworkParams& aOptions);
   CommandResult removeSecondaryRoute(NetworkParams& aOptions);
   CommandResult setNetworkInterfaceAlarm(NetworkParams& aOptions);
   CommandResult enableNetworkInterfaceAlarm(NetworkParams& aOptions);
   CommandResult disableNetworkInterfaceAlarm(NetworkParams& aOptions);
   CommandResult setWifiOperationMode(NetworkParams& aOptions);
@@ -305,17 +304,16 @@ private:
   CommandResult setUSBTethering(NetworkParams& aOptions);
   CommandResult enableUsbRndis(NetworkParams& aOptions);
   CommandResult updateUpStream(NetworkParams& aOptions);
   CommandResult createNetwork(NetworkParams& aOptions);
   CommandResult destroyNetwork(NetworkParams& aOptions);
 
   CommandResult addHostRouteLegacy(NetworkParams& aOptions);
   CommandResult removeHostRouteLegacy(NetworkParams& aOptions);
-  CommandResult removeHostRoutesLegacy(NetworkParams& aOptions);
   CommandResult setDefaultRouteLegacy(NetworkParams& aOptions);
   CommandResult removeDefaultRouteLegacy(NetworkParams& aOptions);
   CommandResult removeNetworkRouteLegacy(NetworkParams& aOptions);
 
 
   /**
    * function pointer array holds all netd commands should be executed
    * in sequence to accomplish a given command by other module.
--- a/dom/system/gonk/nsINetworkService.idl
+++ b/dom/system/gonk/nsINetworkService.idl
@@ -154,17 +154,17 @@ interface nsIDhcpRequestCallback : nsISu
    */
   void dhcpRequestResult(in boolean success, in jsval dhcpInfo);
 };
 
 
 /**
  * Provide network services.
  */
-[scriptable, uuid(138ab267-0007-4c3e-8bfc-a7e1be0b5a6f)]
+[scriptable, uuid(e40dd966-cb04-4dc7-ac4b-6382769c00b9)]
 interface nsINetworkService : nsISupports
 {
   const long MODIFY_ROUTE_ADD    = 0;
   const long MODIFY_ROUTE_REMOVE = 1;
 
   /**
    * Enable or disable Wifi Tethering
    *
@@ -341,24 +341,16 @@ interface nsINetworkService : nsISupport
    */
   jsval modifyRoute(in long      action,
                     in DOMString interfaceName,
                     in DOMString host,
                     in long      prefixLength,
                     [optional] in DOMString gateway);
 
   /**
-   * Remove all host routes.
-   *
-   * @param interfaceName
-   *        The interface name we want remove from the routing table.
-   */
-  void removeHostRoutes(in DOMString interfaceName);
-
-  /**
    * Add route to secondary routing table.
    *
    * @param interfaceName
    *        The network interface for this route.
    * @param route
    *        The route info should have the following fields:
    *        .ip: destination ip address
    *        .prefix: destination prefix