Bug 1120302 - Post message to let setDNS would callback to NetworkManager. r=vchang
authorHenry Chang <hchang@mozilla.com>
Mon, 12 Jan 2015 18:15:50 +0800
changeset 223639 409240119a2b26de76d010243bf0811ac1d069a6
parent 223638 87b3b48ccac024dea4ab3a620386419ad27c3e4e
child 223640 f60b7ca34fed4cc73d9e83ef0d4be60e05159a02
push id28099
push userkwierso@gmail.com
push dateWed, 14 Jan 2015 01:38:51 +0000
treeherdermozilla-central@3100ceecc1bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvchang
bugs1120302
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 1120302 - Post message to let setDNS would callback to NetworkManager. r=vchang
dom/system/gonk/NetworkUtils.cpp
dom/system/gonk/NetworkUtils.h
--- a/dom/system/gonk/NetworkUtils.cpp
+++ b/dom/system/gonk/NetworkUtils.cpp
@@ -245,17 +245,18 @@ const CommandFunc NetworkUtils::sNetwork
 
 const CommandFunc NetworkUtils::sNetworkInterfaceSetAlarmChain[] = {
   NetworkUtils::setAlarm,
   NetworkUtils::networkInterfaceAlarmSuccess
 };
 
 const CommandFunc NetworkUtils::sSetDnsChain[] = {
   NetworkUtils::setDefaultInterface,
-  NetworkUtils::setInterfaceDns
+  NetworkUtils::setInterfaceDns,
+  NetworkUtils::setDnsSuccess,
 };
 
 /**
  * Helper function to get the mask from given prefix length.
  */
 static uint32_t makeMask(const uint32_t prefixLength)
 {
   uint32_t mask = 0;
@@ -1047,16 +1048,24 @@ void NetworkUtils::networkInterfaceAlarm
                                                 NetworkResultOptions& aResult)
 {
   // TODO : error is not used , and it is conflict with boolean type error.
   // params.error = parseFloat(params.resultReason);
   postMessage(aChain->getParams(), aResult);
   finalizeSuccess(aChain, aResult);
 }
 
+void NetworkUtils::setDnsSuccess(CommandChain* aChain,
+                                 CommandCallback aCallback,
+                                 NetworkResultOptions& aResult)
+{
+  postMessage(aChain->getParams(), aResult);
+  finalizeSuccess(aChain, aResult);
+}
+
 void NetworkUtils::updateUpStreamFail(NetworkParams& aOptions, NetworkResultOptions& aResult)
 {
   postMessage(aOptions, aResult);
 }
 
 void NetworkUtils::updateUpStreamSuccess(CommandChain* aChain,
                                          CommandCallback aCallback,
                                          NetworkResultOptions& aResult)
--- a/dom/system/gonk/NetworkUtils.h
+++ b/dom/system/gonk/NetworkUtils.h
@@ -313,16 +313,17 @@ private:
   static void setDefaultInterface(PARAMS);
   static void setInterfaceDns(PARAMS);
   static void wifiTetheringSuccess(PARAMS);
   static void usbTetheringSuccess(PARAMS);
   static void networkInterfaceAlarmSuccess(PARAMS);
   static void updateUpStreamSuccess(PARAMS);
   static void setDhcpServerSuccess(PARAMS);
   static void wifiOperationModeSuccess(PARAMS);
+  static void setDnsSuccess(PARAMS);
 #undef PARAMS
 
   /**
    * Error callback function executed when a command is fail.
    */
 #define PARAMS NetworkParams& aOptions, \
                mozilla::dom::NetworkResultOptions& aResult
   static void wifiTetheringFail(PARAMS);