summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dom/media/PeerConnection.js2
-rw-r--r--dom/push/PushRecord.jsm16
-rw-r--r--dom/push/PushService.jsm11
-rw-r--r--dom/push/PushServiceWebSocket.jsm1
-rw-r--r--dom/push/moz.build7
5 files changed, 18 insertions, 19 deletions
diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js
index 0569b15ae..df36ae83c 100644
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -13,8 +13,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "PeerConnectionIdp",
"resource://gre/modules/media/PeerConnectionIdp.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "convertToRTCStatsReport",
"resource://gre/modules/media/RTCStatsReport.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
const PC_CONTRACT = "@mozilla.org/dom/peerconnection;1";
const PC_OBS_CONTRACT = "@mozilla.org/dom/peerconnectionobserver;1";
diff --git a/dom/push/PushRecord.jsm b/dom/push/PushRecord.jsm
index 08a7678e0..58f808e6c 100644
--- a/dom/push/PushRecord.jsm
+++ b/dom/push/PushRecord.jsm
@@ -9,7 +9,6 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -145,13 +144,14 @@ PushRecord.prototype = {
return Date.now();
}
- if (AppConstants.MOZ_ANDROID_HISTORY) {
- let result = yield Messaging.sendRequestForResult({
- type: "History:GetPrePathLastVisitedTimeMilliseconds",
- prePath: this.uri.prePath,
- });
- return result == 0 ? -Infinity : result;
- }
+#ifdef MOZ_ANDROID_HISTORY
+ let result = yield Messaging.sendRequestForResult({
+ type: "History:GetPrePathLastVisitedTimeMilliseconds",
+ prePath: this.uri.prePath,
+ });
+
+ return result == 0 ? -Infinity : result;
+#endif
// Places History transition types that can fire a
// `pushsubscriptionchange` event when the user visits a site with expired push
diff --git a/dom/push/PushService.jsm b/dom/push/PushService.jsm
index 373807024..07cf70d21 100644
--- a/dom/push/PushService.jsm
+++ b/dom/push/PushService.jsm
@@ -10,7 +10,6 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Timer.jsm");
@@ -24,14 +23,14 @@ const {
const {PushDB} = Cu.import("resource://gre/modules/PushDB.jsm");
const CONNECTION_PROTOCOLS = (function() {
- if ('android' != AppConstants.MOZ_WIDGET_TOOLKIT) {
+#ifdef MOZ_WIDGET_ANDROID
+ const {PushServiceAndroidGCM} = Cu.import("resource://gre/modules/PushServiceAndroidGCM.jsm");
+ return [PushServiceAndroidGCM];
+#else
const {PushServiceWebSocket} = Cu.import("resource://gre/modules/PushServiceWebSocket.jsm");
const {PushServiceHttp2} = Cu.import("resource://gre/modules/PushServiceHttp2.jsm");
return [PushServiceWebSocket, PushServiceHttp2];
- } else {
- const {PushServiceAndroidGCM} = Cu.import("resource://gre/modules/PushServiceAndroidGCM.jsm");
- return [PushServiceAndroidGCM];
- }
+#endif
})();
XPCOMUtils.defineLazyServiceGetter(this, "gPushNotifier",
diff --git a/dom/push/PushServiceWebSocket.jsm b/dom/push/PushServiceWebSocket.jsm
index 46b12b8f0..54348e71c 100644
--- a/dom/push/PushServiceWebSocket.jsm
+++ b/dom/push/PushServiceWebSocket.jsm
@@ -10,7 +10,6 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Services.jsm");
diff --git a/dom/push/moz.build b/dom/push/moz.build
index 7eee8896f..d138b270c 100644
--- a/dom/push/moz.build
+++ b/dom/push/moz.build
@@ -12,12 +12,15 @@ EXTRA_COMPONENTS += [
EXTRA_JS_MODULES += [
'PushCrypto.jsm',
'PushDB.jsm',
- 'PushRecord.jsm',
- 'PushService.jsm',
'PushServiceHttp2.jsm',
'PushServiceWebSocket.jsm',
]
+EXTRA_PP_JS_MODULES += [
+ 'PushRecord.jsm',
+ 'PushService.jsm',
+]
+
MOCHITEST_MANIFESTS += [
'test/mochitest.ini',
]