Bug 920551 - 2.e/2: fix MobileConnection. r=hsinyi,khuey
☠☠ backed out by c027223b3f4a ☠ ☠
authorVicamo Yang <vyang@mozilla.com>
Fri, 25 Oct 2013 11:07:33 +0800
changeset 152154 be4d3ffb4ad005777d79b350ca5f70da42484e20
parent 152153 4e76f41737aab7ad51acffcb8be2a4e7fbd23a2e
child 152155 f15f8b139950d41f44a3036c6eeb7db9e718f1a4
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewershsinyi, khuey
bugs920551
milestone27.0a1
Bug 920551 - 2.e/2: fix MobileConnection. r=hsinyi,khuey
b2g/app/b2g.js
dom/base/Navigator.cpp
dom/network/interfaces/moz.build
dom/network/src/MobileConnection.cpp
dom/network/src/moz.build
modules/libpref/src/init/all.js
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -815,19 +815,16 @@ pref("gfx.canvas.azure.backends", "skia"
 pref("gfx.canvas.azure.accelerated", true);
 
 // Turn on dynamic cache size for Skia
 pref("gfx.canvas.skiagl.dynamic-cache", true);
 
 // Cell Broadcast API
 pref("ril.cellbroadcast.disabled", false);
 
-// Mobile Connection API
-pref("dom.mobileconnection.enabled", true);
-
 // Voice Mail API
 pref("dom.voicemail.enabled", true);
 
 // The url of the page used to display network error details.
 pref("b2g.neterror.url", "app://system.gaiamobile.org/net_error.html");
 
 // Enable Web Speech synthesis API
 pref("media.webspeech.synth.enabled", true);
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -34,18 +34,18 @@
 #include "nsISiteSpecificUserAgent.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StaticPtr.h"
 #include "Connection.h"
 #include "nsDOMEvent.h"
 #include "nsGlobalWindow.h"
 #ifdef MOZ_B2G_RIL
 #include "mozilla/dom/IccManager.h"
-#include "MobileConnection.h"
 #include "mozilla/dom/CellBroadcast.h"
+#include "mozilla/dom/network/MobileConnection.h"
 #include "mozilla/dom/Voicemail.h"
 #endif
 #include "nsIIdleObserver.h"
 #include "nsIPermissionManager.h"
 #include "nsNetUtil.h"
 #include "nsIHttpChannel.h"
 #include "TimeManager.h"
 #include "DeviceStorage.h"
--- a/dom/network/interfaces/moz.build
+++ b/dom/network/interfaces/moz.build
@@ -1,32 +1,32 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPIDL_SOURCES += [
     'nsIDOMConnection.idl',
-    'nsIDOMDataErrorEvent.idl',
     'nsIDOMTCPServerSocket.idl',
     'nsIDOMTCPSocket.idl',
-    'nsIDOMUSSDReceivedEvent.idl',
     'nsIMozNavigatorNetwork.idl',
     'nsITCPServerSocketChild.idl',
     'nsITCPServerSocketParent.idl',
     'nsITCPSocketChild.idl',
     'nsITCPSocketParent.idl',
 ]
 
 if CONFIG['MOZ_B2G_RIL']:
     XPIDL_SOURCES += [
         'nsIDOMCFStateChangeEvent.idl',
+        'nsIDOMDataErrorEvent.idl',
         'nsIDOMMobileConnection.idl',
         'nsIDOMMozEmergencyCbModeEvent.idl',
         'nsIDOMMozOtaStatusEvent.idl',
         'nsIDOMNetworkStats.idl',
         'nsIDOMNetworkStatsManager.idl',
+        'nsIDOMUSSDReceivedEvent.idl',
         'nsIMobileConnectionProvider.idl',
         'nsINetworkStatsServiceProxy.idl',
     ]
 
 XPIDL_MODULE = 'dom_network'
--- a/dom/network/src/MobileConnection.cpp
+++ b/dom/network/src/MobileConnection.cpp
@@ -1,13 +1,14 @@
 /* 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 "MobileConnection.h"
+#include "mozilla/dom/network/MobileConnection.h"
+
 #include "GeneratedEvents.h"
 #include "mozilla/Preferences.h"
 #include "nsDOMEvent.h"
 #include "nsIDOMCFStateChangeEvent.h"
 #include "nsIDOMClassInfo.h"
 #include "nsIDOMDOMRequest.h"
 #include "nsIDOMDataErrorEvent.h"
 #include "nsIDOMMozEmergencyCbModeEvent.h"
--- a/dom/network/src/moz.build
+++ b/dom/network/src/moz.build
@@ -17,16 +17,19 @@ CPP_SOURCES += [
     'Connection.cpp',
     'TCPServerSocketChild.cpp',
     'TCPServerSocketParent.cpp',
     'TCPSocketChild.cpp',
     'TCPSocketParent.cpp',
 ]
 
 if CONFIG['MOZ_B2G_RIL']:
+    EXPORTS.mozilla.dom.network += [
+        'MobileConnection.h',
+    ]
     CPP_SOURCES += [
         'MobileConnection.cpp',
     ]
     EXTRA_JS_MODULES = [
         'NetworkStatsDB.jsm',
         'NetworkStatsService.jsm',
     ]
 
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -4504,17 +4504,21 @@ pref("dom.cellbroadcast.enabled", false)
 // ICC API
 #ifdef MOZ_B2G_RIL
 pref("dom.icc.enabled", true);
 #else
 pref("dom.icc.enabled", false);
 #endif
 
 // Mobile Connection API
+#ifdef MOZ_B2G_RIL
+pref("dom.mobileconnection.enabled", true);
+#else
 pref("dom.mobileconnection.enabled", false);
+#endif
 
 // Voice Mail API
 pref("dom.voicemail.enabled", false);
 // Numeric default service id for Voice Mail API calls with |serviceId|
 // parameter omitted.
 pref("dom.voicemail.defaultServiceId", 0);
 
 // DOM Inter-App Communication API.