diff --git a/dom/fmradio/ipc/moz.build b/dom/fmradio/ipc/moz.build index 4a2d9a5cb2a..a36f3f78c3f 100644 --- a/dom/fmradio/ipc/moz.build +++ b/dom/fmradio/ipc/moz.build @@ -11,7 +11,7 @@ EXPORTS.mozilla.dom += [ 'FMRadioRequestParent.h', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'FMRadioChild.cpp', 'FMRadioParent.cpp', 'FMRadioRequestChild.cpp', diff --git a/dom/fmradio/moz.build b/dom/fmradio/moz.build index 7cc58e53654..74f569ac05d 100644 --- a/dom/fmradio/moz.build +++ b/dom/fmradio/moz.build @@ -15,7 +15,7 @@ if CONFIG['MOZ_B2G_FM']: 'FMRadioService.h', ] - SOURCES += [ + UNIFIED_SOURCES += [ 'FMRadio.cpp', 'FMRadioService.cpp', ] diff --git a/dom/icc/moz.build b/dom/icc/moz.build index 1af25714e01..65d15e16e3a 100644 --- a/dom/icc/moz.build +++ b/dom/icc/moz.build @@ -11,7 +11,7 @@ EXPORTS.mozilla.dom += [ 'IccManager.h', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'Icc.cpp', 'IccListener.cpp', 'IccManager.cpp', diff --git a/dom/mobileconnection/MobileConnection.cpp b/dom/mobileconnection/MobileConnection.cpp index de0d4e1d150..139e1e21b49 100644 --- a/dom/mobileconnection/MobileConnection.cpp +++ b/dom/mobileconnection/MobileConnection.cpp @@ -21,6 +21,9 @@ #include "nsJSUtils.h" #include "nsServiceManagerUtils.h" +#ifdef CONVERT_STRING_TO_NULLABLE_ENUM +#undef CONVERT_STRING_TO_NULLABLE_ENUM +#endif #define CONVERT_STRING_TO_NULLABLE_ENUM(_string, _enumType, _enum) \ { \ uint32_t i = 0; \ diff --git a/dom/mobileconnection/MobileConnectionInfo.cpp b/dom/mobileconnection/MobileConnectionInfo.cpp index 62652548954..9a2ba2fe599 100644 --- a/dom/mobileconnection/MobileConnectionInfo.cpp +++ b/dom/mobileconnection/MobileConnectionInfo.cpp @@ -10,6 +10,9 @@ #include "jsapi.h" +#ifdef CONVERT_STRING_TO_NULLABLE_ENUM +#undef CONVERT_STRING_TO_NULLABLE_ENUM +#endif #define CONVERT_STRING_TO_NULLABLE_ENUM(_string, _enumType, _enum) \ { \ _enum.SetNull(); \ diff --git a/dom/mobileconnection/moz.build b/dom/mobileconnection/moz.build index 416b10d2f47..3b8ab15eabc 100644 --- a/dom/mobileconnection/moz.build +++ b/dom/mobileconnection/moz.build @@ -30,7 +30,7 @@ XPIDL_SOURCES += [ 'interfaces/nsINeighboringCellInfo.idl', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'DOMMMIError.cpp', 'ipc/MobileConnectionChild.cpp', 'ipc/MobileConnectionIPCService.cpp', diff --git a/dom/mobilemessage/gonk/SmsService.cpp b/dom/mobilemessage/gonk/SmsService.cpp index 2dc47e2ed0a..36597f12044 100644 --- a/dom/mobilemessage/gonk/SmsService.cpp +++ b/dom/mobilemessage/gonk/SmsService.cpp @@ -10,16 +10,12 @@ namespace { -const char* kPrefRilNumRadioInterfaces = "ril.numRadioInterfaces"; #define kPrefDefaultServiceId "dom.sms.defaultServiceId" -const char* kObservedPrefs[] = { - kPrefDefaultServiceId, - nullptr -}; uint32_t getDefaultServiceId() { + static const char* kPrefRilNumRadioInterfaces = "ril.numRadioInterfaces"; int32_t id = mozilla::Preferences::GetInt(kPrefDefaultServiceId, 0); int32_t numRil = mozilla::Preferences::GetInt(kPrefRilNumRadioInterfaces, 1); @@ -46,6 +42,10 @@ SmsService::SmsService() NS_WARN_IF_FALSE(mRil, "This shouldn't fail!"); // Initialize observer. + static const char* kObservedPrefs[] = { + kPrefDefaultServiceId, + nullptr + }; Preferences::AddStrongObservers(this, kObservedPrefs); mDefaultServiceId = getDefaultServiceId(); } diff --git a/dom/mobilemessage/ipc/SmsIPCService.cpp b/dom/mobilemessage/ipc/SmsIPCService.cpp index 2ef1d734e4f..09786a23609 100644 --- a/dom/mobilemessage/ipc/SmsIPCService.cpp +++ b/dom/mobilemessage/ipc/SmsIPCService.cpp @@ -19,14 +19,8 @@ using namespace mozilla::dom::mobilemessage; namespace { -const char* kPrefRilNumRadioInterfaces = "ril.numRadioInterfaces"; #define kPrefMmsDefaultServiceId "dom.mms.defaultServiceId" #define kPrefSmsDefaultServiceId "dom.sms.defaultServiceId" -const char* kObservedPrefs[] = { - kPrefMmsDefaultServiceId, - kPrefSmsDefaultServiceId, - nullptr -}; // TODO: Bug 767082 - WebSMS: sSmsChild leaks at shutdown PSmsChild* gSmsChild; @@ -86,6 +80,7 @@ SendCursorRequest(const IPCMobileMessageCursor& aRequest, uint32_t getDefaultServiceId(const char* aPrefKey) { + static const char* kPrefRilNumRadioInterfaces = "ril.numRadioInterfaces"; int32_t id = mozilla::Preferences::GetInt(aPrefKey, 0); int32_t numRil = mozilla::Preferences::GetInt(kPrefRilNumRadioInterfaces, 1); @@ -119,6 +114,11 @@ SmsIPCService::GetSingleton() SmsIPCService::SmsIPCService() { + static const char* kObservedPrefs[] = { + kPrefMmsDefaultServiceId, + kPrefSmsDefaultServiceId, + nullptr + }; Preferences::AddStrongObservers(this, kObservedPrefs); mMmsDefaultServiceId = getDefaultServiceId(kPrefMmsDefaultServiceId); mSmsDefaultServiceId = getDefaultServiceId(kPrefSmsDefaultServiceId); diff --git a/dom/mobilemessage/moz.build b/dom/mobilemessage/moz.build index e0777fb9260..51e9c3e0415 100644 --- a/dom/mobilemessage/moz.build +++ b/dom/mobilemessage/moz.build @@ -35,7 +35,7 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']: 'gonk/MobileMessageDatabaseService.js', 'gonk/MobileMessageDatabaseService.manifest', ] - SOURCES += [ + UNIFIED_SOURCES += [ 'gonk/SmsService.cpp', ] diff --git a/dom/nfc/moz.build b/dom/nfc/moz.build index 8512343ca56..39e1f6fee8a 100644 --- a/dom/nfc/moz.build +++ b/dom/nfc/moz.build @@ -14,7 +14,7 @@ if CONFIG['MOZ_NFC']: EXPORTS.mozilla.dom += [ 'MozNDEFRecord.h', ] - SOURCES += [ + UNIFIED_SOURCES += [ 'MozNDEFRecord.cpp', ] EXTRA_COMPONENTS += [ @@ -24,7 +24,7 @@ if CONFIG['MOZ_NFC']: ] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_NFC']: - SOURCES += [ + UNIFIED_SOURCES += [ 'gonk/NfcMessageHandler.cpp', 'gonk/NfcService.cpp', ] diff --git a/dom/speakermanager/moz.build b/dom/speakermanager/moz.build index 7f82afd0bba..6773c3be7e4 100644 --- a/dom/speakermanager/moz.build +++ b/dom/speakermanager/moz.build @@ -12,7 +12,7 @@ EXPORTS += [ 'SpeakerManagerServiceChild.h', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'SpeakerManager.cpp', 'SpeakerManagerService.cpp', 'SpeakerManagerServiceChild.cpp', diff --git a/dom/system/gonk/Volume.cpp b/dom/system/gonk/Volume.cpp index 0793e7a7f98..39edbe36c79 100644 --- a/dom/system/gonk/Volume.cpp +++ b/dom/system/gonk/Volume.cpp @@ -378,7 +378,7 @@ Volume::HandleVoldResponse(int aResponseCode, nsCWhitespaceTokenizer& aTokenizer // The volume name will have already been parsed, and the tokenizer will point // to the token after the volume name switch (aResponseCode) { - case ResponseCode::VolumeListResult: { + case ::ResponseCode::VolumeListResult: { // Each line will look something like: // // sdcard /mnt/sdcard 1 @@ -397,7 +397,7 @@ Volume::HandleVoldResponse(int aResponseCode, nsCWhitespaceTokenizer& aTokenizer break; } - case ResponseCode::VolumeStateChange: { + case ::ResponseCode::VolumeStateChange: { // Format of the line looks something like: // // Volume sdcard /mnt/sdcard state changed from 7 (Shared-Unmounted) to 1 (Idle-Unmounted) @@ -415,12 +415,12 @@ Volume::HandleVoldResponse(int aResponseCode, nsCWhitespaceTokenizer& aTokenizer break; } - case ResponseCode::VolumeDiskInserted: + case ::ResponseCode::VolumeDiskInserted: SetMediaPresent(true); break; - case ResponseCode::VolumeDiskRemoved: // fall-thru - case ResponseCode::VolumeBadRemoval: + case ::ResponseCode::VolumeDiskRemoved: // fall-thru + case ::ResponseCode::VolumeBadRemoval: SetMediaPresent(false); break; diff --git a/dom/system/gonk/VolumeManager.cpp b/dom/system/gonk/VolumeManager.cpp index 2a61c53888d..7f8feac52e5 100644 --- a/dom/system/gonk/VolumeManager.cpp +++ b/dom/system/gonk/VolumeManager.cpp @@ -143,7 +143,7 @@ class VolumeListCallback : public VolumeResponseCallback virtual void ResponseReceived(const VolumeCommand* aCommand) { switch (ResponseCode()) { - case ResponseCode::VolumeListResult: { + case ::ResponseCode::VolumeListResult: { // Each line will look something like: // // sdcard /mnt/sdcard 1 @@ -157,7 +157,7 @@ class VolumeListCallback : public VolumeResponseCallback break; } - case ResponseCode::CommandOkay: { + case ::ResponseCode::CommandOkay: { // We've received the list of volumes. Tell anybody who // is listening that we're open for business. VolumeManager::SetState(VolumeManager::VOLUMES_READY); @@ -285,7 +285,7 @@ VolumeManager::OnLineRead(int aFd, nsDependentCSubstring& aMessage) nsDependentCString responseLine(endPtr, aMessage.Length() - (endPtr - aMessage.Data())); DBG("Rcvd: %d '%s'", responseCode, responseLine.Data()); - if (responseCode >= ResponseCode::UnsolicitedInformational) { + if (responseCode >= ::ResponseCode::UnsolicitedInformational) { // These are unsolicited broadcasts. We intercept these and process // them ourselves HandleBroadcast(responseCode, responseLine); @@ -294,7 +294,7 @@ VolumeManager::OnLineRead(int aFd, nsDependentCSubstring& aMessage) if (mCommands.size() > 0) { VolumeCommand* cmd = mCommands.front(); cmd->HandleResponse(responseCode, responseLine); - if (responseCode >= ResponseCode::CommandOkay) { + if (responseCode >= ::ResponseCode::CommandOkay) { // That's a terminating response. We can remove the command. mCommands.pop(); mCommandPending = false; diff --git a/dom/system/gonk/moz.build b/dom/system/gonk/moz.build index 08366ea6aa9..d80a1a74df0 100644 --- a/dom/system/gonk/moz.build +++ b/dom/system/gonk/moz.build @@ -35,7 +35,7 @@ EXPORTS += [ 'nsVolume.h', 'nsVolumeService.h', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'AudioChannelManager.cpp', 'AudioManager.cpp', 'AutoMounter.cpp', diff --git a/dom/wifi/moz.build b/dom/wifi/moz.build index 9481aec42bf..b88a2a07d91 100644 --- a/dom/wifi/moz.build +++ b/dom/wifi/moz.build @@ -30,7 +30,7 @@ EXTRA_JS_MODULES += [ ] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - SOURCES = [ + UNIFIED_SOURCES = [ 'WifiCertService.cpp', 'WifiHotspotUtils.cpp', 'WifiProxyService.cpp',