Bug 1072701 - Build some Firefox OS specific DOM code in unified mode; r=baku

--HG--
extra : rebase_source : 4a8812c18341c9851fb3265e1f8e6c77a95911c5
This commit is contained in:
Ehsan Akhgari 2014-09-25 10:10:42 -04:00
Родитель 6efaad6645
Коммит 2124657509
15 изменённых файлов: 36 добавлений и 30 удалений

Просмотреть файл

@ -11,7 +11,7 @@ EXPORTS.mozilla.dom += [
'FMRadioRequestParent.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'FMRadioChild.cpp',
'FMRadioParent.cpp',
'FMRadioRequestChild.cpp',

Просмотреть файл

@ -15,7 +15,7 @@ if CONFIG['MOZ_B2G_FM']:
'FMRadioService.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'FMRadio.cpp',
'FMRadioService.cpp',
]

Просмотреть файл

@ -11,7 +11,7 @@ EXPORTS.mozilla.dom += [
'IccManager.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'Icc.cpp',
'IccListener.cpp',
'IccManager.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; \

Просмотреть файл

@ -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(); \

Просмотреть файл

@ -30,7 +30,7 @@ XPIDL_SOURCES += [
'interfaces/nsINeighboringCellInfo.idl',
]
SOURCES += [
UNIFIED_SOURCES += [
'DOMMMIError.cpp',
'ipc/MobileConnectionChild.cpp',
'ipc/MobileConnectionIPCService.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();
}

Просмотреть файл

@ -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);

Просмотреть файл

@ -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',
]

Просмотреть файл

@ -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',
]

Просмотреть файл

@ -12,7 +12,7 @@ EXPORTS += [
'SpeakerManagerServiceChild.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'SpeakerManager.cpp',
'SpeakerManagerService.cpp',
'SpeakerManagerServiceChild.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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -35,7 +35,7 @@ EXPORTS += [
'nsVolume.h',
'nsVolumeService.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'AudioChannelManager.cpp',
'AudioManager.cpp',
'AutoMounter.cpp',

Просмотреть файл

@ -30,7 +30,7 @@ EXTRA_JS_MODULES += [
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
SOURCES = [
UNIFIED_SOURCES = [
'WifiCertService.cpp',
'WifiHotspotUtils.cpp',
'WifiProxyService.cpp',