diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index bc7318041b1..50c88e7970e 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -430,7 +430,7 @@ pref("services.push.requestTimeout", 10000); pref("services.push.udp.wakeupEnabled", true); // NetworkStats -#ifdef MOZ_WIDGET_GONK +#ifdef MOZ_B2G_RIL pref("dom.mozNetworkStats.enabled", true); pref("dom.webapps.firstRunWithSIM", true); #endif diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 96f3fb49b55..610e2fea5bf 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -18,7 +18,7 @@ Cu.import("resource://gre/modules/AppsUtils.jsm"); Cu.import('resource://gre/modules/UserAgentOverrides.jsm'); Cu.import('resource://gre/modules/Keyboard.jsm'); Cu.import('resource://gre/modules/ErrorPage.jsm'); -#ifdef MOZ_WIDGET_GONK +#ifdef MOZ_B2G_RIL Cu.import('resource://gre/modules/NetworkStatsService.jsm'); #endif @@ -611,7 +611,7 @@ var shell = { this.sendEvent(window, 'ContentStart'); -#ifdef MOZ_WIDGET_GONK +#ifdef MOZ_B2G_RIL Cu.import('resource://gre/modules/OperatorApps.jsm'); #endif diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index 39bd1ee846f..94a072219d9 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -164,12 +164,10 @@ @BINPATH@/components/dom_audiochannel.xpt @BINPATH@/components/dom_base.xpt @BINPATH@/components/dom_system.xpt -#ifdef MOZ_WIDGET_GONK -@BINPATH@/components/dom_wifi.xpt -@BINPATH@/components/dom_system_gonk.xpt -#endif #ifdef MOZ_B2G_RIL @BINPATH@/components/dom_voicemail.xpt +@BINPATH@/components/dom_wifi.xpt +@BINPATH@/components/dom_system_gonk.xpt @BINPATH@/components/dom_icc.xpt @BINPATH@/components/dom_cellbroadcast.xpt @BINPATH@/components/dom_wappush.xpt @@ -402,31 +400,11 @@ @BINPATH@/components/nsSidebar.manifest @BINPATH@/components/nsSidebar.js -; WiFi, NetworkManager, NetworkStats -#ifdef MOZ_WIDGET_GONK -@BINPATH@/components/DOMWifiManager.js -@BINPATH@/components/DOMWifiManager.manifest -@BINPATH@/components/NetworkInterfaceListService.js -@BINPATH@/components/NetworkInterfaceListService.manifest -@BINPATH@/components/NetworkManager.js -@BINPATH@/components/NetworkManager.manifest -@BINPATH@/components/NetworkStatsManager.js -@BINPATH@/components/NetworkStatsManager.manifest -@BINPATH@/components/NetworkStatsServiceProxy.js -@BINPATH@/components/NetworkStatsServiceProxy.manifest -@BINPATH@/components/WifiWorker.js -@BINPATH@/components/WifiWorker.manifest -#endif // MOZ_WIDGET_GONK - -; RIL #if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) @BINPATH@/components/MmsService.js @BINPATH@/components/MmsService.manifest @BINPATH@/components/MobileMessageDatabaseService.js @BINPATH@/components/MobileMessageDatabaseService.manifest -@BINPATH@/components/RadioInterfaceLayer.js -@BINPATH@/components/RadioInterfaceLayer.manifest -@BINPATH@/components/RILContentHelper.js @BINPATH@/components/TelephonyProvider.js @BINPATH@/components/TelephonyProvider.manifest #endif // MOZ_WIDGET_GONK && MOZ_B2G_RIL @@ -496,6 +474,23 @@ @BINPATH@/components/webvtt.xpt @BINPATH@/components/WebVTT.manifest @BINPATH@/components/WebVTTParserWrapper.js +#ifdef MOZ_B2G_RIL +@BINPATH@/components/NetworkManager.manifest +@BINPATH@/components/NetworkManager.js +@BINPATH@/components/RadioInterfaceLayer.manifest +@BINPATH@/components/RadioInterfaceLayer.js +@BINPATH@/components/RILContentHelper.js +@BINPATH@/components/WifiWorker.js +@BINPATH@/components/WifiWorker.manifest +@BINPATH@/components/DOMWifiManager.js +@BINPATH@/components/DOMWifiManager.manifest +@BINPATH@/components/NetworkStatsManager.js +@BINPATH@/components/NetworkStatsManager.manifest +@BINPATH@/components/NetworkInterfaceListService.manifest +@BINPATH@/components/NetworkInterfaceListService.js +@BINPATH@/components/NetworkStatsServiceProxy.manifest +@BINPATH@/components/NetworkStatsServiceProxy.js +#endif #ifdef MOZ_ENABLE_DBUS @BINPATH@/components/@DLL_PREFIX@dbusservice@DLL_SUFFIX@ #endif diff --git a/content/events/src/Makefile.in b/content/events/src/Makefile.in index 94e86a92f77..0c18ec676b6 100644 --- a/content/events/src/Makefile.in +++ b/content/events/src/Makefile.in @@ -19,7 +19,7 @@ LOCAL_INCLUDES += \ -I$(srcdir)/../../../layout/xul/tree/ \ $(NULL) -ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) +ifdef MOZ_B2G_RIL LOCAL_INCLUDES += \ -I$(srcdir)/../../../dom/wifi \ $(NULL) diff --git a/dom/dom-config.mk b/dom/dom-config.mk index 53216fb53d7..4c1cb7b52c0 100644 --- a/dom/dom-config.mk +++ b/dom/dom-config.mk @@ -37,7 +37,7 @@ DOM_SRCDIRS = \ dom/camera \ $(NULL) -ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) +ifdef MOZ_B2G_RIL DOM_SRCDIRS += \ dom/system/gonk \ dom/wifi \ diff --git a/dom/moz.build b/dom/moz.build index d0b32a2f080..546df28c830 100644 --- a/dom/moz.build +++ b/dom/moz.build @@ -80,11 +80,9 @@ PARALLEL_DIRS += [ if CONFIG['OS_ARCH'] == 'WINNT': PARALLEL_DIRS += ['plugins/ipc/hangui'] -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - PARALLEL_DIRS += ['wifi'] - if CONFIG['MOZ_B2G_RIL']: PARALLEL_DIRS += [ + 'wifi', 'icc', 'cellbroadcast', 'voicemail', diff --git a/dom/network/interfaces/moz.build b/dom/network/interfaces/moz.build index 48988202d26..23d8baa07e5 100644 --- a/dom/network/interfaces/moz.build +++ b/dom/network/interfaces/moz.build @@ -22,14 +22,10 @@ if CONFIG['MOZ_B2G_RIL']: 'nsIDOMMobileConnection.idl', 'nsIDOMMozEmergencyCbModeEvent.idl', 'nsIDOMMozOtaStatusEvent.idl', - 'nsIDOMUSSDReceivedEvent.idl', - 'nsIMobileConnectionProvider.idl', - ] - -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - XPIDL_SOURCES += [ 'nsIDOMNetworkStats.idl', 'nsIDOMNetworkStatsManager.idl', + 'nsIDOMUSSDReceivedEvent.idl', + 'nsIMobileConnectionProvider.idl', 'nsINetworkStatsServiceProxy.idl', ] diff --git a/dom/network/src/moz.build b/dom/network/src/moz.build index b823f8a8371..d90e909d616 100644 --- a/dom/network/src/moz.build +++ b/dom/network/src/moz.build @@ -28,8 +28,6 @@ if CONFIG['MOZ_B2G_RIL']: CPP_SOURCES += [ 'MobileConnection.cpp', ] - -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': EXTRA_JS_MODULES = [ 'NetworkStatsDB.jsm', 'NetworkStatsService.jsm', @@ -45,7 +43,7 @@ EXTRA_PP_COMPONENTS += [ 'TCPSocket.js', ] -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': +if CONFIG['MOZ_B2G_RIL']: EXTRA_COMPONENTS += [ 'NetworkStatsManager.js', 'NetworkStatsManager.manifest', diff --git a/dom/network/tests/Makefile.in b/dom/network/tests/Makefile.in index cc1bd18cacb..52fcdb65ce1 100644 --- a/dom/network/tests/Makefile.in +++ b/dom/network/tests/Makefile.in @@ -9,7 +9,7 @@ MOCHITEST_FILES = \ test_tcpsocket_enabled_with_perm.html \ $(NULL) -ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) +ifdef MOZ_B2G_RIL MOCHITEST_FILES = \ test_networkstats_basics.html \ test_networkstats_disabled.html \ diff --git a/dom/system/gonk/NetworkManager.js b/dom/system/gonk/NetworkManager.js index 210ff91fd91..9d986e7d135 100644 --- a/dom/system/gonk/NetworkManager.js +++ b/dom/system/gonk/NetworkManager.js @@ -133,10 +133,8 @@ function defineLazyRegExp(obj, name, pattern) { function NetworkManager() { this.networkInterfaces = {}; Services.obs.addObserver(this, TOPIC_INTERFACE_STATE_CHANGED, true); -#ifdef MOZ_B2G_RIL Services.obs.addObserver(this, TOPIC_INTERFACE_REGISTERED, true); Services.obs.addObserver(this, TOPIC_INTERFACE_UNREGISTERED, true); -#endif Services.obs.addObserver(this, TOPIC_XPCOM_SHUTDOWN, false); Services.obs.addObserver(this, TOPIC_MOZSETTINGS_CHANGED, false); @@ -231,7 +229,6 @@ NetworkManager.prototype = { debug("Network " + network.name + " changed state to " + network.state); switch (network.state) { case Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED: -#ifdef MOZ_B2G_RIL // Add host route for data calls if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || @@ -241,17 +238,14 @@ NetworkManager.prototype = { } // Add extra host route. For example, mms proxy or mmsc. this.setExtraHostRoute(network); -#endif // Remove pre-created default route and let setAndConfigureActive() // to set default route only on preferred network this.removeDefaultRoute(network.name); this.setAndConfigureActive(); -#ifdef MOZ_B2G_RIL // Update data connection when Wifi connected/disconnected if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) { this.mRIL.getRadioInterface(0).updateRILNetworkInterface(); } -#endif this.onConnectionChanged(network); @@ -259,7 +253,6 @@ NetworkManager.prototype = { CaptivePortalDetectionHelper.notify(CaptivePortalDetectionHelper.EVENT_CONNECT, this.active); break; case Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED: -#ifdef MOZ_B2G_RIL // Remove host route for data calls if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || @@ -268,28 +261,22 @@ NetworkManager.prototype = { } // Remove extra host route. For example, mms proxy or mmsc. this.removeExtraHostRoute(network); -#endif // Remove routing table in /proc/net/route if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) { this.resetRoutingTable(network); -#ifdef MOZ_B2G_RIL } else if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE) { this.removeDefaultRoute(network.name); -#endif } // Abort ongoing captive portal detection on the wifi interface CaptivePortalDetectionHelper.notify(CaptivePortalDetectionHelper.EVENT_DISCONNECT, network); this.setAndConfigureActive(); -#ifdef MOZ_B2G_RIL // Update data connection when Wifi connected/disconnected if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) { this.mRIL.getRadioInterface(0).updateRILNetworkInterface(); } -#endif break; } break; -#ifdef MOZ_B2G_RIL case TOPIC_INTERFACE_REGISTERED: let regNetwork = subject.QueryInterface(Ci.nsINetworkInterface); // Add extra host route. For example, mms proxy or mmsc. @@ -300,7 +287,6 @@ NetworkManager.prototype = { // Remove extra host route. For example, mms proxy or mmsc. this.removeExtraHostRoute(unregNetwork); break; -#endif case TOPIC_MOZSETTINGS_CHANGED: let setting = JSON.parse(data); this.handle(setting.key, setting.value); @@ -313,10 +299,8 @@ NetworkManager.prototype = { case TOPIC_XPCOM_SHUTDOWN: Services.obs.removeObserver(this, TOPIC_XPCOM_SHUTDOWN); Services.obs.removeObserver(this, TOPIC_MOZSETTINGS_CHANGED); -#ifdef MOZ_B2G_RIL Services.obs.removeObserver(this, TOPIC_INTERFACE_REGISTERED); Services.obs.removeObserver(this, TOPIC_INTERFACE_UNREGISTERED); -#endif Services.obs.removeObserver(this, TOPIC_INTERFACE_STATE_CHANGED); break; } @@ -325,19 +309,15 @@ NetworkManager.prototype = { receiveMessage: function receiveMessage(aMsg) { switch (aMsg.name) { case "NetworkInterfaceList:ListInterface": { -#ifdef MOZ_B2G_RIL let excludeMms = aMsg.json.exculdeMms; let excludeSupl = aMsg.json.exculdeSupl; -#endif let interfaces = []; for each (let i in this.networkInterfaces) { -#ifdef MOZ_B2G_RIL if ((i.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS && excludeMms) || (i.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL && excludeSupl)) { continue; } -#endif interfaces.push({ state: i.state, type: i.type, @@ -369,14 +349,12 @@ NetworkManager.prototype = { Cr.NS_ERROR_INVALID_ARG); } this.networkInterfaces[network.name] = network; -#ifdef MOZ_B2G_RIL // Add host route for data calls if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) { this.addHostRoute(network); } -#endif // Remove pre-created default route and let setAndConfigureActive() // to set default route only on preferred network this.removeDefaultRoute(network.name); @@ -395,14 +373,12 @@ NetworkManager.prototype = { Cr.NS_ERROR_INVALID_ARG); } delete this.networkInterfaces[network.name]; -#ifdef MOZ_B2G_RIL // Remove host route for data calls if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) { this.removeHostRoute(network); } -#endif this.setAndConfigureActive(); Services.obs.notifyObservers(network, TOPIC_INTERFACE_UNREGISTERED, null); debug("Network '" + network.name + "' unregistered."); @@ -417,12 +393,8 @@ NetworkManager.prototype = { return this._preferredNetworkType; }, set preferredNetworkType(val) { -#ifdef MOZ_B2G_RIL if ([Ci.nsINetworkInterface.NETWORK_TYPE_WIFI, Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE].indexOf(val) == -1) { -#else - if (val != Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) { -#endif throw "Invalid network type"; } this._preferredNetworkType = val; @@ -435,12 +407,10 @@ NetworkManager.prototype = { _activeInfo: null, overrideActive: function overrideActive(network) { -#ifdef MOZ_B2G_RIL if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS || network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) { throw "Invalid network type"; } -#endif this._overriddenActive = network; this.setAndConfigureActive(); }, @@ -512,7 +482,6 @@ NetworkManager.prototype = { } }, -#ifdef MOZ_B2G_RIL setExtraHostRoute: function setExtraHostRoute(network) { if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS) { debug("Network '" + network.name + "' registered, adding mmsproxy and/or mmsc route"); @@ -532,7 +501,6 @@ NetworkManager.prototype = { this.removeHostRouteWithResolve(network, mmsHosts); } }, -#endif // MOZ_B2G_RIL /** * Determine the active interface and configure it. @@ -540,6 +508,7 @@ NetworkManager.prototype = { setAndConfigureActive: function setAndConfigureActive() { debug("Evaluating whether active network needs to be changed."); let oldActive = this.active; + let defaultDataNetwork; if (this._overriddenActive) { debug("We have an override for the active network: " + @@ -565,18 +534,13 @@ NetworkManager.prototype = { // Find a suitable network interface to activate. this.active = null; this._activeInfo = Object.create(null); -#ifdef MOZ_B2G_RIL - let defaultDataNetwork; -#endif for each (let network in this.networkInterfaces) { if (network.state != Ci.nsINetworkInterface.NETWORK_STATE_CONNECTED) { continue; } -#ifdef MOZ_B2G_RIL if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE) { defaultDataNetwork = network; } -#endif this.active = network; this._activeInfo = {name:network.name, ip:network.ip, netmask:network.netmask}; if (network.type == this.preferredNetworkType) { @@ -585,7 +549,6 @@ NetworkManager.prototype = { } } if (this.active) { -#ifdef MOZ_B2G_RIL // Give higher priority to default data APN than seconary APN. // If default data APN is not connected, we still set default route // and DNS on seconary APN. @@ -600,11 +563,8 @@ NetworkManager.prototype = { this.active.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) { this.setDNS(this.active); } else { -#endif // MOZ_B2G_RIL this.setDefaultRouteAndDNS(oldActive); -#ifdef MOZ_B2G_RIL } -#endif if (this.active != oldActive) { Services.obs.notifyObservers(this.active, TOPIC_ACTIVE_CHANGED, null); } @@ -629,7 +589,6 @@ NetworkManager.prototype = { this.worker.postMessage(options); }, -#ifdef MOZ_B2G_RIL setDNS: function setDNS(networkInterface) { debug("Going DNS to " + networkInterface.name); let options = { @@ -640,7 +599,6 @@ NetworkManager.prototype = { }; this.worker.postMessage(options); }, -#endif setDefaultRouteAndDNS: function setDefaultRouteAndDNS(oldInterface) { debug("Going to change route and DNS to " + this.active.name); @@ -665,7 +623,6 @@ NetworkManager.prototype = { this.worker.postMessage(options); }, -#ifdef MOZ_B2G_RIL addHostRoute: function addHostRoute(network) { debug("Going to add host route on " + network.name); let options = { @@ -745,7 +702,6 @@ NetworkManager.prototype = { }; this.worker.postMessage(options); }, -#endif // MOZ_B2G_RIL setNetworkProxy: function setNetworkProxy(network) { try { @@ -1264,11 +1220,9 @@ let CaptivePortalDetectionHelper = (function() { }; }()); -#ifdef MOZ_B2G_RIL XPCOMUtils.defineLazyServiceGetter(NetworkManager.prototype, "mRIL", "@mozilla.org/ril;1", "nsIRadioInterfaceLayer"); -#endif this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkManager]); diff --git a/dom/system/gonk/SystemWorkerManager.cpp b/dom/system/gonk/SystemWorkerManager.cpp index 637760689d3..a3dd23cef4b 100644 --- a/dom/system/gonk/SystemWorkerManager.cpp +++ b/dom/system/gonk/SystemWorkerManager.cpp @@ -24,13 +24,13 @@ #include "jsfriendapi.h" #include "mozilla/dom/workers/Workers.h" +#ifdef MOZ_WIDGET_GONK #include "mozilla/ipc/Netd.h" #include "AutoMounter.h" #include "TimeZoneSettingObserver.h" #include "AudioManager.h" -#ifdef MOZ_B2G_RIL -#include "mozilla/ipc/Ril.h" #endif +#include "mozilla/ipc/Ril.h" #include "mozilla/ipc/KeyStore.h" #include "nsIObserverService.h" #include "nsCxPusher.h" @@ -44,7 +44,9 @@ USING_WORKERS_NAMESPACE using namespace mozilla::dom::gonk; using namespace mozilla::ipc; +#ifdef MOZ_WIDGET_GONK using namespace mozilla::system; +#endif #define NS_NETWORKMANAGER_CID \ { 0x33901e46, 0x33b8, 0x11e1, \ @@ -58,6 +60,107 @@ NS_DEFINE_CID(kNetworkManagerCID, NS_NETWORKMANAGER_CID); // Doesn't carry a reference, we're owned by services. SystemWorkerManager *gInstance = nullptr; +class ConnectWorkerToRIL : public WorkerTask +{ +public: + ConnectWorkerToRIL() + { } + + virtual bool RunTask(JSContext *aCx); +}; + +class SendRilSocketDataTask : public nsRunnable +{ +public: + SendRilSocketDataTask(unsigned long aClientId, + UnixSocketRawData *aRawData) + : mRawData(aRawData) + , mClientId(aClientId) + { } + + NS_IMETHOD Run() + { + MOZ_ASSERT(NS_IsMainThread()); + SystemWorkerManager::SendRilRawData(mClientId, mRawData); + return NS_OK; + } + +private: + UnixSocketRawData *mRawData; + unsigned long mClientId; +}; + +bool +PostToRIL(JSContext *cx, unsigned argc, JS::Value *vp) +{ + NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread"); + + if (argc != 2) { + JS_ReportError(cx, "Expecting two arguments with the RIL message"); + return false; + } + + JS::Value cv = JS_ARGV(cx, vp)[0]; + int clientId = cv.toInt32(); + + JS::Value v = JS_ARGV(cx, vp)[1]; + + JSAutoByteString abs; + void *data; + size_t size; + if (JSVAL_IS_STRING(v)) { + JSString *str = JSVAL_TO_STRING(v); + if (!abs.encodeUtf8(cx, str)) { + return false; + } + + data = abs.ptr(); + size = abs.length(); + } else if (!JSVAL_IS_PRIMITIVE(v)) { + JSObject *obj = JSVAL_TO_OBJECT(v); + if (!JS_IsTypedArrayObject(obj)) { + JS_ReportError(cx, "Object passed in wasn't a typed array"); + return false; + } + + uint32_t type = JS_GetArrayBufferViewType(obj); + if (type != js::ArrayBufferView::TYPE_INT8 && + type != js::ArrayBufferView::TYPE_UINT8 && + type != js::ArrayBufferView::TYPE_UINT8_CLAMPED) { + JS_ReportError(cx, "Typed array data is not octets"); + return false; + } + + size = JS_GetTypedArrayByteLength(obj); + data = JS_GetArrayBufferViewData(obj); + } else { + JS_ReportError(cx, + "Incorrect argument. Expecting a string or a typed array"); + return false; + } + + UnixSocketRawData* raw = new UnixSocketRawData(data, size); + + nsRefPtr task = new SendRilSocketDataTask(clientId, raw); + NS_DispatchToMainThread(task); + return true; +} + +bool +ConnectWorkerToRIL::RunTask(JSContext *aCx) +{ + // Set up the postRILMessage on the function for worker -> RIL thread + // communication. + NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread"); + NS_ASSERTION(!JS_IsRunning(aCx), "Are we being called somehow?"); + JSObject *workerGlobal = JS::CurrentGlobalOrNull(aCx); + + return !!JS_DefineFunction(aCx, workerGlobal, "postRILMessage", PostToRIL, 1, + 0); +} + +#ifdef MOZ_WIDGET_GONK + bool DoNetdCommand(JSContext *cx, unsigned argc, JS::Value *vp) { @@ -203,6 +306,8 @@ NetdReceiver::DispatchNetdEvent::RunTask(JSContext *aCx) argv, argv); } +#endif // MOZ_WIDGET_GONK + } // anonymous namespace SystemWorkerManager::SystemWorkerManager() @@ -240,12 +345,14 @@ SystemWorkerManager::Init() InitKeyStore(cx); +#ifdef MOZ_WIDGET_GONK InitAutoMounter(); InitializeTimeZoneSettingObserver(); rv = InitNetd(cx); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr audioManager = do_GetService(NS_AUDIOMANAGER_CONTRACTID); +#endif nsCOMPtr obs = mozilla::services::GetObserverService(); if (!obs) { @@ -269,14 +376,21 @@ SystemWorkerManager::Shutdown() mShutdown = true; +#ifdef MOZ_WIDGET_GONK ShutdownAutoMounter(); - -#ifdef MOZ_B2G_RIL - RilConsumer::Shutdown(); #endif + for (unsigned long i = 0; i < mRilConsumers.Length(); i++) { + if (mRilConsumers[i]) { + mRilConsumers[i]->Shutdown(); + mRilConsumers[i] = nullptr; + } + } + +#ifdef MOZ_WIDGET_GONK StopNetd(); mNetdWorker = nullptr; +#endif nsCOMPtr wifi(do_QueryInterface(mWifiWorker)); if (wifi) { @@ -319,6 +433,20 @@ SystemWorkerManager::GetInterfaceRequestor() return gInstance; } +bool +SystemWorkerManager::SendRilRawData(unsigned long aClientId, + UnixSocketRawData* aRaw) +{ + if ((gInstance->mRilConsumers.Length() <= aClientId) || + !gInstance->mRilConsumers[aClientId] || + gInstance->mRilConsumers[aClientId]->GetConnectionStatus() != SOCKET_CONNECTED) { + // Probably shuting down. + delete aRaw; + return true; + } + return gInstance->mRilConsumers[aClientId]->SendSocketData(aRaw); +} + NS_IMETHODIMP SystemWorkerManager::GetInterface(const nsIID &aIID, void **aResult) { @@ -329,10 +457,12 @@ SystemWorkerManager::GetInterface(const nsIID &aIID, void **aResult) reinterpret_cast(aResult)); } +#ifdef MOZ_WIDGET_GONK if (aIID.Equals(NS_GET_IID(nsINetworkManager))) { return CallQueryInterface(mNetdWorker, reinterpret_cast(aResult)); } +#endif NS_WARNING("Got nothing for the requested IID!"); return NS_ERROR_NO_INTERFACE; @@ -343,11 +473,15 @@ SystemWorkerManager::RegisterRilWorker(unsigned int aClientId, const JS::Value& aWorker, JSContext *aCx) { -#ifndef MOZ_B2G_RIL - return NS_ERROR_NOT_IMPLEMENTED; -#else NS_ENSURE_TRUE(!JSVAL_IS_PRIMITIVE(aWorker), NS_ERROR_UNEXPECTED); + mRilConsumers.EnsureLengthAtLeast(aClientId + 1); + + if (mRilConsumers[aClientId]) { + NS_WARNING("RilConsumer already registered"); + return NS_ERROR_FAILURE; + } + JSAutoCompartment ac(aCx, JSVAL_TO_OBJECT(aWorker)); WorkerCrossThreadDispatcher *wctd = @@ -357,10 +491,18 @@ SystemWorkerManager::RegisterRilWorker(unsigned int aClientId, return NS_ERROR_FAILURE; } - return RilConsumer::Register(aClientId, wctd); -#endif // MOZ_B2G_RIL + nsRefPtr connection = new ConnectWorkerToRIL(); + if (!wctd->PostTask(connection)) { + NS_WARNING("Failed to connect worker to ril"); + return NS_ERROR_UNEXPECTED; + } + + // Now that we're set up, connect ourselves to the RIL thread. + mRilConsumers[aClientId] = new RilConsumer(aClientId, wctd); + return NS_OK; } +#ifdef MOZ_WIDGET_GONK nsresult SystemWorkerManager::InitNetd(JSContext *cx) { @@ -393,6 +535,7 @@ SystemWorkerManager::InitNetd(JSContext *cx) mNetdWorker = worker; return NS_OK; } +#endif nsresult SystemWorkerManager::InitWifi(JSContext *cx) diff --git a/dom/system/gonk/SystemWorkerManager.h b/dom/system/gonk/SystemWorkerManager.h index 1562a80eb75..0198e6584b0 100644 --- a/dom/system/gonk/SystemWorkerManager.h +++ b/dom/system/gonk/SystemWorkerManager.h @@ -23,13 +23,18 @@ #include "nsIObserver.h" #include "nsAutoPtr.h" #include "nsCOMPtr.h" -#include "nsXULAppAPI.h" // For XRE_GetProcessType +#include "nsDebug.h" +#include "nsDOMEventTargetHelper.h" +#include "nsString.h" +#include "nsTArray.h" class nsIWorkerHolder; namespace mozilla { namespace ipc { + class RilConsumer; + class UnixSocketRawData; class KeyStore; } @@ -55,17 +60,25 @@ public: static nsIInterfaceRequestor* GetInterfaceRequestor(); + static bool SendRilRawData(unsigned long aClientId, + ipc::UnixSocketRawData* aRaw); + private: SystemWorkerManager(); ~SystemWorkerManager(); +#ifdef MOZ_WIDGET_GONK nsresult InitNetd(JSContext *cx); +#endif nsresult InitWifi(JSContext *cx); nsresult InitKeyStore(JSContext *cx); +#ifdef MOZ_WIDGET_GONK nsCOMPtr mNetdWorker; +#endif nsCOMPtr mWifiWorker; + nsTArray > mRilConsumers; nsRefPtr mKeyStore; bool mShutdown; diff --git a/dom/system/gonk/moz.build b/dom/system/gonk/moz.build index 361a6d4b17f..3f5e6d5c061 100644 --- a/dom/system/gonk/moz.build +++ b/dom/system/gonk/moz.build @@ -18,6 +18,7 @@ XPIDL_SOURCES += [ 'nsIAudioManager.idl', 'nsINetworkInterfaceListService.idl', 'nsINetworkManager.idl', + 'nsIRadioInterfaceLayer.idl', 'nsISystemWorkerManager.idl', 'nsIVolume.idl', 'nsIVolumeMountLock.idl', @@ -30,60 +31,54 @@ XPIDL_MODULE = 'dom_system_gonk' MODULE = 'dom' -EXPORTS += [ - 'GonkGPSGeolocationProvider.h', - 'nsVolume.h', - 'nsVolumeService.h', -] -CPP_SOURCES += [ - 'AudioChannelManager.cpp', - 'AudioManager.cpp', - 'AutoMounter.cpp', - 'AutoMounterSetting.cpp', - 'GonkGPSGeolocationProvider.cpp', - 'nsVolume.cpp', - 'nsVolumeMountLock.cpp', - 'nsVolumeService.cpp', - 'nsVolumeStat.cpp', - 'OpenFileFinder.cpp', - 'SystemWorkerManager.cpp', - 'TimeZoneSettingObserver.cpp', - 'Volume.cpp', - 'VolumeCommand.cpp', - 'VolumeManager.cpp', - 'VolumeServiceIOThread.cpp', - 'VolumeServiceTest.cpp', -] +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': + EXPORTS += [ + 'GonkGPSGeolocationProvider.h', + 'nsVolume.h', + 'nsVolumeService.h', + ] + CPP_SOURCES += [ + 'AudioChannelManager.cpp', + 'AudioManager.cpp', + 'AutoMounter.cpp', + 'AutoMounterSetting.cpp', + 'GonkGPSGeolocationProvider.cpp', + 'nsVolume.cpp', + 'nsVolumeMountLock.cpp', + 'nsVolumeService.cpp', + 'nsVolumeStat.cpp', + 'OpenFileFinder.cpp', + 'TimeZoneSettingObserver.cpp', + 'Volume.cpp', + 'VolumeCommand.cpp', + 'VolumeManager.cpp', + 'VolumeServiceIOThread.cpp', + 'VolumeServiceTest.cpp', + ] if CONFIG['ENABLE_TESTS']: XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini'] +CPP_SOURCES += [ + 'SystemWorkerManager.cpp', +] + EXTRA_COMPONENTS += [ 'NetworkInterfaceListService.js', 'NetworkInterfaceListService.manifest', - 'NetworkManager.manifest', -] -EXTRA_PP_COMPONENTS += [ 'NetworkManager.js', -] -EXTRA_JS_MODULES += [ - 'net_worker.js', - 'systemlibs.js', + 'NetworkManager.manifest', + 'RadioInterfaceLayer.js', + 'RadioInterfaceLayer.manifest', + 'RILContentHelper.js', ] -if CONFIG['MOZ_B2G_RIL']: - XPIDL_SOURCES += [ - 'nsIRadioInterfaceLayer.idl', - ] - EXTRA_COMPONENTS += [ - 'RadioInterfaceLayer.js', - 'RadioInterfaceLayer.manifest', - 'RILContentHelper.js', - ] - EXTRA_JS_MODULES += [ - 'ril_consts.js', - 'ril_worker.js', - ] +EXTRA_JS_MODULES += [ + 'net_worker.js', + 'ril_consts.js', + 'ril_worker.js', + 'systemlibs.js', +] FAIL_ON_WARNINGS = True diff --git a/dom/system/moz.build b/dom/system/moz.build index 0cb256a9c61..c296a74d9d9 100644 --- a/dom/system/moz.build +++ b/dom/system/moz.build @@ -14,7 +14,8 @@ elif toolkit == 'cocoa': DIRS += ['mac'] elif toolkit == 'android': DIRS += ['android'] -elif toolkit == 'gonk': + +if CONFIG['MOZ_B2G_RIL']: DIRS += ['gonk'] TEST_DIRS += ['tests'] diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index f068654568a..cbd96112657 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -513,13 +513,9 @@ if CONFIG['MOZ_B2G_RIL']: 'MozStkCommandEvent.webidl', 'MozVoicemail.webidl', 'MozVoicemailEvent.webidl', - 'USSDReceivedEvent.webidl', - ] - -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - WEBIDL_FILES += [ 'MozWifiConnectionInfoEvent.webidl', 'MozWifiStatusChangeEvent.webidl', + 'USSDReceivedEvent.webidl', ] if CONFIG['MOZ_WEBSPEECH']: diff --git a/ipc/moz.build b/ipc/moz.build index 1dc549316da..7b9711ced12 100644 --- a/ipc/moz.build +++ b/ipc/moz.build @@ -17,10 +17,10 @@ if CONFIG['MOZ_B2G_RIL']: if CONFIG['MOZ_B2G_BT_BLUEZ']: DIRS += ['dbus'] -if CONFIG['MOZ_B2G_RIL'] or CONFIG['MOZ_B2G_BT'] or CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - DIRS += ['unixsocket'] +if CONFIG['MOZ_B2G_RIL'] or CONFIG['MOZ_B2G_BT']: + DIRS += ['unixsocket', 'keystore'] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - DIRS += ['netd', 'keystore'] + DIRS += ['netd'] TOOL_DIRS += ['app'] diff --git a/ipc/ril/Ril.cpp b/ipc/ril/Ril.cpp index 4897a568e6f..558a18df22e 100644 --- a/ipc/ril/Ril.cpp +++ b/ipc/ril/Ril.cpp @@ -4,8 +4,6 @@ * 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 "mozilla/ipc/Ril.h" - #include #include #include @@ -20,8 +18,8 @@ #endif #include "jsfriendapi.h" -#include "nsTArray.h" #include "nsThreadUtils.h" // For NS_IsMainThread. +#include "Ril.h" USING_WORKERS_NAMESPACE using namespace mozilla::ipc; @@ -34,130 +32,17 @@ const char* RIL_SOCKET_NAME = "/dev/socket/rilproxy"; // desktop development. const uint32_t RIL_TEST_PORT = 6200; -nsTArray > sRilConsumers; - -class ConnectWorkerToRIL : public WorkerTask -{ -public: - ConnectWorkerToRIL() - { } - - virtual bool RunTask(JSContext *aCx); -}; - -class SendRilSocketDataTask : public nsRunnable -{ -public: - SendRilSocketDataTask(unsigned long aClientId, - UnixSocketRawData *aRawData) - : mRawData(aRawData) - , mClientId(aClientId) - { } - - NS_IMETHOD Run() - { - MOZ_ASSERT(NS_IsMainThread()); - - if (sRilConsumers.Length() <= mClientId || - !sRilConsumers[mClientId] || - sRilConsumers[mClientId]->GetConnectionStatus() != SOCKET_CONNECTED) { - // Probably shuting down. - delete mRawData; - return NS_OK; - } - - sRilConsumers[mClientId]->SendSocketData(mRawData); - return NS_OK; - } - -private: - UnixSocketRawData *mRawData; - unsigned long mClientId; -}; - -bool -PostToRIL(JSContext *aCx, - unsigned aArgc, - JS::Value *aArgv) -{ - NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread"); - - if (aArgc != 2) { - JS_ReportError(aCx, "Expecting two arguments with the RIL message"); - return false; - } - - JS::Value cv = JS_ARGV(aCx, aArgv)[0]; - int clientId = cv.toInt32(); - - JS::Value v = JS_ARGV(aCx, aArgv)[1]; - - JSAutoByteString abs; - void *data; - size_t size; - if (JSVAL_IS_STRING(v)) { - JSString *str = JSVAL_TO_STRING(v); - if (!abs.encodeUtf8(aCx, str)) { - return false; - } - - data = abs.ptr(); - size = abs.length(); - } else if (!JSVAL_IS_PRIMITIVE(v)) { - JSObject *obj = JSVAL_TO_OBJECT(v); - if (!JS_IsTypedArrayObject(obj)) { - JS_ReportError(aCx, "Object passed in wasn't a typed array"); - return false; - } - - uint32_t type = JS_GetArrayBufferViewType(obj); - if (type != js::ArrayBufferView::TYPE_INT8 && - type != js::ArrayBufferView::TYPE_UINT8 && - type != js::ArrayBufferView::TYPE_UINT8_CLAMPED) { - JS_ReportError(aCx, "Typed array data is not octets"); - return false; - } - - size = JS_GetTypedArrayByteLength(obj); - data = JS_GetArrayBufferViewData(obj); - } else { - JS_ReportError(aCx, - "Incorrect argument. Expecting a string or a typed array"); - return false; - } - - UnixSocketRawData* raw = new UnixSocketRawData(data, size); - - nsRefPtr task = - new SendRilSocketDataTask(clientId, raw); - NS_DispatchToMainThread(task); - return true; -} - -bool -ConnectWorkerToRIL::RunTask(JSContext *aCx) -{ - // Set up the postRILMessage on the function for worker -> RIL thread - // communication. - NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread"); - NS_ASSERTION(!JS_IsRunning(aCx), "Are we being called somehow?"); - JSObject *workerGlobal = JS::CurrentGlobalOrNull(aCx); - - return !!JS_DefineFunction(aCx, workerGlobal, - "postRILMessage", PostToRIL, 1, 0); -} - class DispatchRILEvent : public WorkerTask { public: - DispatchRILEvent(UnixSocketRawData* aMessage) - : mMessage(aMessage) - { } + DispatchRILEvent(UnixSocketRawData* aMessage) + : mMessage(aMessage) + { } - virtual bool RunTask(JSContext *aCx); + virtual bool RunTask(JSContext *aCx); private: - nsAutoPtr mMessage; + nsAutoPtr mMessage; }; bool @@ -299,45 +184,11 @@ RilConsumer::RilConsumer(unsigned long aClientId, ConnectSocket(new RilConnector(mClientId), mAddress.get()); } -nsresult -RilConsumer::Register(unsigned int aClientId, - WorkerCrossThreadDispatcher* aDispatcher) -{ - MOZ_ASSERT(NS_IsMainThread()); - - sRilConsumers.EnsureLengthAtLeast(aClientId + 1); - - if (sRilConsumers[aClientId]) { - NS_WARNING("RilConsumer already registered"); - return NS_ERROR_FAILURE; - } - - nsRefPtr connection = new ConnectWorkerToRIL(); - if (!aDispatcher->PostTask(connection)) { - NS_WARNING("Failed to connect worker to ril"); - return NS_ERROR_UNEXPECTED; - } - - // Now that we're set up, connect ourselves to the RIL thread. - sRilConsumers[aClientId] = new RilConsumer(aClientId, aDispatcher); - return NS_OK; -} - void RilConsumer::Shutdown() { - MOZ_ASSERT(NS_IsMainThread()); - - for (unsigned long i = 0; i < sRilConsumers.Length(); i++) { - nsRefPtr& instance = sRilConsumers[i]; - if (!instance) { - continue; - } - - instance->mShutdown = true; - instance->CloseSocket(); - instance = nullptr; - } + mShutdown = true; + CloseSocket(); } void @@ -353,20 +204,20 @@ void RilConsumer::OnConnectSuccess() { // Nothing to do here. - LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__); + LOG("RIL[%u]: %s\n", mClientId, __FUNCTION__); } void RilConsumer::OnConnectError() { - LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__); + LOG("RIL[%u]: %s\n", mClientId, __FUNCTION__); CloseSocket(); } void RilConsumer::OnDisconnect() { - LOG("RIL[%lu]: %s\n", mClientId, __FUNCTION__); + LOG("RIL[%u]: %s\n", mClientId, __FUNCTION__); if (!mShutdown) { ConnectSocket(new RilConnector(mClientId), mAddress.get(), 1000); } diff --git a/ipc/ril/Ril.h b/ipc/ril/Ril.h index ce294a412ce..bb4d1c7daee 100644 --- a/ipc/ril/Ril.h +++ b/ipc/ril/Ril.h @@ -16,16 +16,13 @@ namespace ipc { class RilConsumer : public mozilla::ipc::UnixSocketConsumer { public: - virtual ~RilConsumer() { } - - static nsresult Register(unsigned int aClientId, - mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher); - static void Shutdown(); - -private: RilConsumer(unsigned long aClientId, mozilla::dom::workers::WorkerCrossThreadDispatcher* aDispatcher); + virtual ~RilConsumer() { } + void Shutdown(); + +private: virtual void ReceiveSocketData(nsAutoPtr& aMessage); virtual void OnConnectSuccess(); diff --git a/js/xpconnect/src/event_impl_gen.conf.in b/js/xpconnect/src/event_impl_gen.conf.in index f5bee202365..f9c7e8779e4 100644 --- a/js/xpconnect/src/event_impl_gen.conf.in +++ b/js/xpconnect/src/event_impl_gen.conf.in @@ -23,10 +23,6 @@ simple_events = [ 'StyleRuleChangeEvent', 'StyleSheetChangeEvent', 'StyleSheetApplicableStateChangeEvent', -#ifdef MOZ_WIDGET_GONK - 'MozWifiStatusChangeEvent', - 'MozWifiConnectionInfoEvent', -#endif #ifdef MOZ_B2G_BT 'BluetoothDeviceEvent', 'BluetoothStatusChangedEvent', @@ -36,6 +32,8 @@ simple_events = [ 'DataErrorEvent', 'MozEmergencyCbModeEvent', 'MozOtaStatusEvent', + 'MozWifiStatusChangeEvent', + 'MozWifiConnectionInfoEvent', 'MozCellBroadcastEvent', 'MozVoicemailEvent', 'USSDReceivedEvent', diff --git a/layout/build/Makefile.in b/layout/build/Makefile.in index 7141804eb2b..2aa1e6baa9d 100644 --- a/layout/build/Makefile.in +++ b/layout/build/Makefile.in @@ -127,14 +127,9 @@ endif #} SHARED_LIBRARY_LIBS += $(DEPTH)/dom/camera/$(LIB_PREFIX)domcamera_s.$(LIB_SUFFIX) -ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) -SHARED_LIBRARY_LIBS += \ - $(DEPTH)/dom/system/gonk/$(LIB_PREFIX)domsystemgonk_s.$(LIB_SUFFIX) \ - $(NULL) -endif #} - ifdef MOZ_B2G_RIL #{ SHARED_LIBRARY_LIBS += \ + $(DEPTH)/dom/system/gonk/$(LIB_PREFIX)domsystemgonk_s.$(LIB_SUFFIX) \ $(DEPTH)/dom/icc/src/$(LIB_PREFIX)dom_icc_s.$(LIB_SUFFIX) \ $(DEPTH)/dom/cellbroadcast/src/$(LIB_PREFIX)dom_cellbroadcast_s.$(LIB_SUFFIX) \ $(DEPTH)/dom/voicemail/$(LIB_PREFIX)domvoicemail_s.$(LIB_SUFFIX) \ @@ -332,7 +327,7 @@ ifdef MOZ_GSTREAMER LOCAL_INCLUDES += $(GSTREAMER_CFLAGS) endif -ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) +ifdef MOZ_B2G_RIL #{ LOCAL_INCLUDES += -I$(topsrcdir)/dom/system/gonk endif #} diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 1c144b0c219..53e33d9b87c 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -101,7 +101,7 @@ #include "mozilla/dom/nsSynthVoiceRegistry.h" #endif -#ifdef MOZ_WIDGET_GONK +#ifdef MOZ_B2G_RIL #include "SystemWorkerManager.h" using mozilla::dom::gonk::SystemWorkerManager; #define SYSTEMWORKERMANAGER_CID \ @@ -288,7 +288,7 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DOMRequestService, DOMRequestService::FactoryCreate) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(QuotaManager, QuotaManager::FactoryCreate) -#ifdef MOZ_WIDGET_GONK +#ifdef MOZ_B2G_RIL NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(SystemWorkerManager, SystemWorkerManager::FactoryCreate) #endif @@ -754,7 +754,7 @@ NS_DEFINE_NAMED_CID(NS_TEXTEDITOR_CID); NS_DEFINE_NAMED_CID(INDEXEDDB_MANAGER_CID); NS_DEFINE_NAMED_CID(DOMREQUEST_SERVICE_CID); NS_DEFINE_NAMED_CID(QUOTA_MANAGER_CID); -#ifdef MOZ_WIDGET_GONK +#ifdef MOZ_B2G_RIL NS_DEFINE_NAMED_CID(SYSTEMWORKERMANAGER_CID); #endif #ifdef MOZ_B2G_BT @@ -1043,7 +1043,7 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kINDEXEDDB_MANAGER_CID, false, nullptr, IndexedDatabaseManagerConstructor }, { &kDOMREQUEST_SERVICE_CID, false, nullptr, DOMRequestServiceConstructor }, { &kQUOTA_MANAGER_CID, false, nullptr, QuotaManagerConstructor }, -#ifdef MOZ_WIDGET_GONK +#ifdef MOZ_B2G_RIL { &kSYSTEMWORKERMANAGER_CID, true, nullptr, SystemWorkerManagerConstructor }, #endif #ifdef MOZ_B2G_BT @@ -1201,7 +1201,7 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { INDEXEDDB_MANAGER_CONTRACTID, &kINDEXEDDB_MANAGER_CID }, { DOMREQUEST_SERVICE_CONTRACTID, &kDOMREQUEST_SERVICE_CID }, { QUOTA_MANAGER_CONTRACTID, &kQUOTA_MANAGER_CID }, -#ifdef MOZ_WIDGET_GONK +#ifdef MOZ_B2G_RIL { SYSTEMWORKERMANAGER_CONTRACTID, &kSYSTEMWORKERMANAGER_CID }, #endif #ifdef MOZ_B2G_BT @@ -1286,8 +1286,8 @@ static const mozilla::Module::CategoryEntry kLayoutCategories[] = { { "app-startup", "Volume Service", "service," NS_VOLUMESERVICE_CONTRACTID }, #endif CONTENTDLF_CATEGORIES -#ifdef MOZ_WIDGET_GONK - { "profile-after-change", "Gonk System Worker Manager", SYSTEMWORKERMANAGER_CONTRACTID }, +#ifdef MOZ_B2G_RIL + { "profile-after-change", "Telephony System Worker Manager", SYSTEMWORKERMANAGER_CONTRACTID }, #endif #ifdef MOZ_B2G_BT { "profile-after-change", "Bluetooth Service", BLUETOOTHSERVICE_CONTRACTID }, diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in index afd43ab5e1d..80b4dc72f4a 100644 --- a/toolkit/library/Makefile.in +++ b/toolkit/library/Makefile.in @@ -96,12 +96,12 @@ OS_LIBS += -ldbus endif endif #} -ifneq ($(strip $(MOZ_B2G_RIL)$(MOZ_B2G_BT)$(filter gonk,$(MOZ_WIDGET_TOOLKIT))),) #{ -STATIC_LIBS += mozipcunixsocket_s +ifneq ($(strip $(MOZ_B2G_RIL)$(MOZ_B2G_BT)),) #{ +STATIC_LIBS += mozipcunixsocket_s mozkeystore_s endif #} ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) -STATIC_LIBS += moznetd_s mozkeystore_s +STATIC_LIBS += moznetd_s endif ifdef MOZ_B2G_CAMERA #{