зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 229adcc669b5 (bug 1795968) for causing linting failures on rejected-words.yml. CLOSED TREE
This commit is contained in:
Родитель
6a11e4885b
Коммит
7a374cefcb
|
@ -2,6 +2,8 @@
|
|||
* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
var DEBUG = 0;
|
||||
var debug;
|
||||
if (DEBUG) {
|
||||
|
@ -12,11 +14,13 @@ if (DEBUG) {
|
|||
debug = function(s) {};
|
||||
}
|
||||
|
||||
var EXPORTED_SYMBOLS = ["IndexedDBHelper"];
|
||||
|
||||
function getErrorName(err) {
|
||||
return (err && err.name) || "UnknownError";
|
||||
}
|
||||
|
||||
export function IndexedDBHelper() {}
|
||||
function IndexedDBHelper() {}
|
||||
|
||||
IndexedDBHelper.prototype = {
|
||||
// Close the database
|
|
@ -530,7 +530,7 @@ if CONFIG["CPU_ARCH"].startswith("ppc"):
|
|||
EXTRA_JS_MODULES += [
|
||||
"ContentAreaDropListener.jsm",
|
||||
"DOMRequestHelper.jsm",
|
||||
"IndexedDBHelper.sys.mjs",
|
||||
"IndexedDBHelper.jsm",
|
||||
"LocationHelper.jsm",
|
||||
"ProcessSelector.jsm",
|
||||
"SlowScriptDebug.jsm",
|
||||
|
|
|
@ -2,8 +2,11 @@
|
|||
* 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/. */
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
const { DOMRequestIpcHelper } = ChromeUtils.import(
|
||||
"resource://gre/modules/DOMRequestHelper.jsm"
|
||||
);
|
||||
|
@ -34,7 +37,7 @@ const PUSH_CID = Components.ID("{cde1d019-fad8-4044-b141-65fb4fb7a245}");
|
|||
* to the web application. The PushService running in the parent process is the
|
||||
* one actually performing all operations.
|
||||
*/
|
||||
export function Push() {
|
||||
function Push() {
|
||||
lazy.console.debug("Push()");
|
||||
}
|
||||
|
||||
|
@ -323,3 +326,5 @@ PushSubscriptionCallback.prototype = {
|
|||
this.reject(error);
|
||||
},
|
||||
};
|
||||
|
||||
const EXPORTED_SYMBOLS = ["Push"];
|
|
@ -2,15 +2,19 @@
|
|||
* 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/. */
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
const lazy = {};
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
JSONFile: "resource://gre/modules/JSONFile.sys.mjs",
|
||||
PushService: "resource://gre/modules/PushService.sys.mjs",
|
||||
});
|
||||
|
||||
// BroadcastService is exported for test purposes.
|
||||
const EXPORTED_SYMBOLS = ["pushBroadcastService", "BroadcastService"];
|
||||
|
||||
// We are supposed to ignore any updates with this version.
|
||||
const DUMMY_VERSION_STRING = "____NOP____";
|
||||
|
||||
|
@ -23,6 +27,11 @@ XPCOMUtils.defineLazyGetter(lazy, "console", () => {
|
|||
prefix: "BroadcastService",
|
||||
});
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"PushService",
|
||||
"resource://gre/modules/PushService.jsm"
|
||||
);
|
||||
|
||||
class InvalidSourceInfo extends Error {
|
||||
constructor(message) {
|
||||
|
@ -33,7 +42,7 @@ class InvalidSourceInfo extends Error {
|
|||
|
||||
const BROADCAST_SERVICE_VERSION = 1;
|
||||
|
||||
export var BroadcastService = class {
|
||||
var BroadcastService = class {
|
||||
constructor(pushService, path) {
|
||||
this.PHASES = {
|
||||
HELLO: "hello",
|
||||
|
@ -296,4 +305,4 @@ function initializeBroadcastService() {
|
|||
return new BroadcastService(lazy.PushService, path);
|
||||
}
|
||||
|
||||
export var pushBroadcastService = initializeBroadcastService();
|
||||
var pushBroadcastService = initializeBroadcastService();
|
|
@ -2,12 +2,16 @@
|
|||
* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* This file exports XPCOM components for C++ and chrome JavaScript callers to
|
||||
* interact with the Push service.
|
||||
*/
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
var isParent =
|
||||
Services.appinfo.processType === Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
|
||||
|
@ -17,8 +21,8 @@ const lazy = {};
|
|||
// The default Push service implementation.
|
||||
XPCOMUtils.defineLazyGetter(lazy, "PushService", function() {
|
||||
if (Services.prefs.getBoolPref("dom.push.enabled")) {
|
||||
const { PushService } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PushService.sys.mjs"
|
||||
const { PushService } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushService.jsm"
|
||||
);
|
||||
PushService.init();
|
||||
return PushService;
|
||||
|
@ -582,4 +586,6 @@ PushSubscription.prototype = {
|
|||
|
||||
// Export the correct implementation depending on whether we're running in
|
||||
// the parent or content process.
|
||||
export let Service = isParent ? PushServiceParent : PushServiceContent;
|
||||
let Service = isParent ? PushServiceParent : PushServiceContent;
|
||||
|
||||
const EXPORTED_SYMBOLS = ["Service"];
|
|
@ -2,7 +2,11 @@
|
|||
* 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/. */
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
@ -11,6 +15,8 @@ XPCOMUtils.defineLazyGetter(lazy, "gDOMBundle", () =>
|
|||
);
|
||||
|
||||
// getCryptoParamsFromHeaders is exported for test purposes.
|
||||
const EXPORTED_SYMBOLS = ["PushCrypto", "getCryptoParamsFromHeaders"];
|
||||
|
||||
const UTF8 = new TextEncoder("utf-8");
|
||||
|
||||
const ECDH_KEY = { name: "ECDH", namedCurve: "P-256" };
|
||||
|
@ -133,7 +139,7 @@ function getCryptoParamsFromPayload(payload) {
|
|||
// Extracts the sender public key, salt, and record size from the `Crypto-Key`,
|
||||
// `Encryption-Key`, and `Encryption` headers for the aesgcm and aesgcm128
|
||||
// schemes.
|
||||
export function getCryptoParamsFromHeaders(headers) {
|
||||
function getCryptoParamsFromHeaders(headers) {
|
||||
if (!headers) {
|
||||
return null;
|
||||
}
|
||||
|
@ -592,7 +598,7 @@ class aesgcm128Decoder extends OldSchemeDecoder {
|
|||
}
|
||||
}
|
||||
|
||||
export var PushCrypto = {
|
||||
var PushCrypto = {
|
||||
concatArray,
|
||||
|
||||
generateAuthenticationSecret() {
|
|
@ -2,8 +2,16 @@
|
|||
* 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/. */
|
||||
|
||||
import { IndexedDBHelper } from "resource://gre/modules/IndexedDBHelper.sys.mjs";
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
"use strict";
|
||||
|
||||
const { IndexedDBHelper } = ChromeUtils.import(
|
||||
"resource://gre/modules/IndexedDBHelper.jsm"
|
||||
);
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const EXPORTED_SYMBOLS = ["PushDB"];
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
@ -17,7 +25,7 @@ XPCOMUtils.defineLazyGetter(lazy, "console", () => {
|
|||
});
|
||||
});
|
||||
|
||||
export function PushDB(dbName, dbVersion, dbStoreName, keyPath, model) {
|
||||
function PushDB(dbName, dbVersion, dbStoreName, keyPath, model) {
|
||||
lazy.console.debug("PushDB()");
|
||||
this._dbStoreName = dbStoreName;
|
||||
this._keyPath = keyPath;
|
|
@ -2,7 +2,11 @@
|
|||
* 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/. */
|
||||
|
||||
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
|
||||
"use strict";
|
||||
|
||||
const { AppConstants } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AppConstants.sys.mjs"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
@ -17,12 +21,14 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
|
||||
});
|
||||
|
||||
const EXPORTED_SYMBOLS = ["PushRecord"];
|
||||
|
||||
const prefs = Services.prefs.getBranch("dom.push.");
|
||||
|
||||
/**
|
||||
* The push subscription record, stored in IndexedDB.
|
||||
*/
|
||||
export function PushRecord(props) {
|
||||
function PushRecord(props) {
|
||||
this.pushEndpoint = props.pushEndpoint;
|
||||
this.scope = props.scope;
|
||||
this.originAttributes = props.originAttributes;
|
|
@ -2,15 +2,19 @@
|
|||
* 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/. */
|
||||
|
||||
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
|
||||
"use strict";
|
||||
|
||||
const { AppConstants } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AppConstants.sys.mjs"
|
||||
);
|
||||
const { clearTimeout, setTimeout } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Timer.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
export var PushServiceWebSocket;
|
||||
export var PushServiceHttp2;
|
||||
var PushServiceWebSocket, PushServiceHttp2;
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
@ -20,25 +24,42 @@ XPCOMUtils.defineLazyServiceGetter(
|
|||
"@mozilla.org/push/Notifier;1",
|
||||
"nsIPushNotifier"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
PushCrypto: "resource://gre/modules/PushCrypto.sys.mjs",
|
||||
PushServiceAndroidGCM: "resource://gre/modules/PushServiceAndroidGCM.sys.mjs",
|
||||
pushBroadcastService: "resource://gre/modules/PushBroadcastService.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"pushBroadcastService",
|
||||
"resource://gre/modules/PushBroadcastService.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"PushCrypto",
|
||||
"resource://gre/modules/PushCrypto.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"PushServiceAndroidGCM",
|
||||
"resource://gre/modules/PushServiceAndroidGCM.jsm"
|
||||
);
|
||||
|
||||
const CONNECTION_PROTOCOLS = (function() {
|
||||
if ("android" != AppConstants.MOZ_WIDGET_TOOLKIT) {
|
||||
({ PushServiceWebSocket } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PushServiceWebSocket.sys.mjs"
|
||||
({ PushServiceWebSocket } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushServiceWebSocket.jsm"
|
||||
));
|
||||
({ PushServiceHttp2 } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PushServiceHttp2.sys.mjs"
|
||||
({ PushServiceHttp2 } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushServiceHttp2.jsm"
|
||||
));
|
||||
return [PushServiceWebSocket, PushServiceHttp2];
|
||||
}
|
||||
return [lazy.PushServiceAndroidGCM];
|
||||
})();
|
||||
|
||||
const EXPORTED_SYMBOLS = [
|
||||
"PushService",
|
||||
// The items below are exported for test purposes.
|
||||
"PushServiceHttp2",
|
||||
"PushServiceWebSocket",
|
||||
];
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "console", () => {
|
||||
let { ConsoleAPI } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Console.sys.mjs"
|
||||
|
@ -118,7 +139,7 @@ function errorWithResult(message, result = Cr.NS_ERROR_FAILURE) {
|
|||
* (PushServiceWebSocket) to communicate with the server and PushDB (IndexedDB)
|
||||
* for persistence.
|
||||
*/
|
||||
export var PushService = {
|
||||
var PushService = {
|
||||
_service: null,
|
||||
_state: PUSH_SERVICE_UNINIT,
|
||||
_db: null,
|
|
@ -2,16 +2,30 @@
|
|||
* 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/. */
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
import { PushRecord } from "resource://gre/modules/PushRecord.sys.mjs";
|
||||
import { Preferences } from "resource://gre/modules/Preferences.sys.mjs";
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
const { PushRecord } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushRecord.jsm"
|
||||
);
|
||||
const { Preferences } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Preferences.sys.mjs"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
PushCrypto: "resource://gre/modules/PushCrypto.sys.mjs",
|
||||
PushDB: "resource://gre/modules/PushDB.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"PushDB",
|
||||
"resource://gre/modules/PushDB.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"PushCrypto",
|
||||
"resource://gre/modules/PushCrypto.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"EventDispatcher",
|
||||
|
@ -24,6 +38,8 @@ XPCOMUtils.defineLazyGetter(lazy, "Log", () => {
|
|||
).AndroidLog.bind("Push");
|
||||
});
|
||||
|
||||
const EXPORTED_SYMBOLS = ["PushServiceAndroidGCM"];
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "console", () => {
|
||||
let { ConsoleAPI } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Console.sys.mjs"
|
||||
|
@ -47,7 +63,7 @@ const prefs = new Preferences("dom.push.");
|
|||
* The implementation of WebPush push backed by Android's GCM
|
||||
* delivery.
|
||||
*/
|
||||
export var PushServiceAndroidGCM = {
|
||||
var PushServiceAndroidGCM = {
|
||||
_mainPushService: null,
|
||||
_serverURI: null,
|
||||
|
|
@ -2,16 +2,25 @@
|
|||
* 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/. */
|
||||
|
||||
import { PushDB } from "resource://gre/modules/PushDB.sys.mjs";
|
||||
import { PushRecord } from "resource://gre/modules/PushRecord.sys.mjs";
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
"use strict";
|
||||
|
||||
const { PushDB } = ChromeUtils.import("resource://gre/modules/PushDB.jsm");
|
||||
const { PushRecord } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushRecord.jsm"
|
||||
);
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { clearTimeout, setTimeout } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Timer.sys.mjs"
|
||||
);
|
||||
|
||||
import { PushCrypto } from "resource://gre/modules/PushCrypto.sys.mjs";
|
||||
const { PushCrypto } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushCrypto.jsm"
|
||||
);
|
||||
|
||||
var EXPORTED_SYMBOLS = ["PushServiceHttp2"];
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
@ -396,7 +405,7 @@ function linkParser(linkHeader, serverURI) {
|
|||
/**
|
||||
* The implementation of the WebPush.
|
||||
*/
|
||||
export var PushServiceHttp2 = {
|
||||
var PushServiceHttp2 = {
|
||||
_mainPushService: null,
|
||||
_serverURI: null,
|
||||
|
|
@ -2,17 +2,27 @@
|
|||
* 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/. */
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
"use strict";
|
||||
|
||||
import { PushDB } from "resource://gre/modules/PushDB.sys.mjs";
|
||||
import { PushRecord } from "resource://gre/modules/PushRecord.sys.mjs";
|
||||
import { PushCrypto } from "resource://gre/modules/PushCrypto.sys.mjs";
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const { PushDB } = ChromeUtils.import("resource://gre/modules/PushDB.jsm");
|
||||
const { PushRecord } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushRecord.jsm"
|
||||
);
|
||||
const { PushCrypto } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushCrypto.jsm"
|
||||
);
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
pushBroadcastService: "resource://gre/modules/PushBroadcastService.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"pushBroadcastService",
|
||||
"resource://gre/modules/PushBroadcastService.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"ObjectUtils",
|
||||
|
@ -49,6 +59,8 @@ const kDELIVERY_REASON_TO_CODE = {
|
|||
|
||||
const prefs = Services.prefs.getBranch("dom.push.");
|
||||
|
||||
const EXPORTED_SYMBOLS = ["PushServiceWebSocket"];
|
||||
|
||||
XPCOMUtils.defineLazyGetter(lazy, "console", () => {
|
||||
let { ConsoleAPI } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Console.sys.mjs"
|
||||
|
@ -120,7 +132,7 @@ const STATE_WAITING_FOR_HELLO = 2;
|
|||
// Websocket operational, handshake completed, begin protocol messaging.
|
||||
const STATE_READY = 3;
|
||||
|
||||
export var PushServiceWebSocket = {
|
||||
var PushServiceWebSocket = {
|
||||
_mainPushService: null,
|
||||
_serverURI: null,
|
||||
_currentlyRegistering: new Set(),
|
|
@ -8,7 +8,7 @@ Classes = [
|
|||
{
|
||||
'cid': '{cde1d019-fad8-4044-b141-65fb4fb7a245}',
|
||||
'contract_ids': ['@mozilla.org/push/PushManager;1'],
|
||||
'esModule': 'resource://gre/modules/Push.sys.mjs',
|
||||
'jsm': 'resource://gre/modules/Push.jsm',
|
||||
'constructor': 'Push',
|
||||
},
|
||||
]
|
||||
|
@ -18,7 +18,7 @@ if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] != 'android':
|
|||
{
|
||||
'cid': '{daaa8d73-677e-4233-8acd-2c404bd01658}',
|
||||
'contract_ids': ['@mozilla.org/push/Service;1'],
|
||||
'esModule': 'resource://gre/modules/PushComponents.sys.mjs',
|
||||
'jsm': 'resource://gre/modules/PushComponents.jsm',
|
||||
'constructor': 'Service',
|
||||
},
|
||||
]
|
||||
|
|
|
@ -11,25 +11,25 @@ EXTRA_COMPONENTS += [
|
|||
]
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
"Push.sys.mjs",
|
||||
"PushBroadcastService.sys.mjs",
|
||||
"PushComponents.sys.mjs",
|
||||
"PushCrypto.sys.mjs",
|
||||
"PushDB.sys.mjs",
|
||||
"PushRecord.sys.mjs",
|
||||
"PushService.sys.mjs",
|
||||
"Push.jsm",
|
||||
"PushBroadcastService.jsm",
|
||||
"PushComponents.jsm",
|
||||
"PushCrypto.jsm",
|
||||
"PushDB.jsm",
|
||||
"PushRecord.jsm",
|
||||
"PushService.jsm",
|
||||
]
|
||||
|
||||
if CONFIG["MOZ_BUILD_APP"] != "mobile/android":
|
||||
# Everything but Fennec.
|
||||
EXTRA_JS_MODULES += [
|
||||
"PushServiceHttp2.sys.mjs",
|
||||
"PushServiceWebSocket.sys.mjs",
|
||||
"PushServiceHttp2.jsm",
|
||||
"PushServiceWebSocket.jsm",
|
||||
]
|
||||
else:
|
||||
# Fennec only.
|
||||
EXTRA_JS_MODULES += [
|
||||
"PushServiceAndroidGCM.sys.mjs",
|
||||
"PushServiceAndroidGCM.jsm",
|
||||
]
|
||||
|
||||
XPCOM_MANIFESTS += [
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
export var broadcastHandler = {
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["broadcastHandler"];
|
||||
|
||||
var broadcastHandler = {
|
||||
reset() {
|
||||
this.notifications = [];
|
||||
|
|
@ -11,16 +11,16 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
|
||||
Preferences: "resource://gre/modules/Preferences.sys.mjs",
|
||||
PushCrypto: "resource://gre/modules/PushCrypto.sys.mjs",
|
||||
PushService: "resource://gre/modules/PushService.sys.mjs",
|
||||
PushServiceHttp2: "resource://gre/modules/PushService.sys.mjs",
|
||||
PushServiceWebSocket: "resource://gre/modules/PushService.sys.mjs",
|
||||
pushBroadcastService: "resource://gre/modules/PushBroadcastService.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
|
||||
PermissionTestUtils: "resource://testing-common/PermissionTestUtils.jsm",
|
||||
pushBroadcastService: "resource://gre/modules/PushBroadcastService.jsm",
|
||||
PushCrypto: "resource://gre/modules/PushCrypto.jsm",
|
||||
PushService: "resource://gre/modules/PushService.jsm",
|
||||
PushServiceHttp2: "resource://gre/modules/PushService.jsm",
|
||||
PushServiceWebSocket: "resource://gre/modules/PushService.jsm",
|
||||
});
|
||||
var {
|
||||
clearInterval,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
TESTING_JS_MODULES += [
|
||||
"broadcast_handler.sys.mjs",
|
||||
"broadcast_handler.jsm",
|
||||
]
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// Create the profile directory early to ensure pushBroadcastService
|
||||
// is initialized with the correct path
|
||||
do_get_profile();
|
||||
const { BroadcastService } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PushBroadcastService.sys.mjs"
|
||||
const { BroadcastService } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushBroadcastService.jsm"
|
||||
);
|
||||
const { JSONFile } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/JSONFile.sys.mjs"
|
||||
|
@ -16,8 +16,8 @@ const { JSONFile } = ChromeUtils.importESModule(
|
|||
const { FileTestUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/FileTestUtils.jsm"
|
||||
);
|
||||
const { broadcastHandler } = ChromeUtils.importESModule(
|
||||
"resource://test/broadcast_handler.sys.mjs"
|
||||
const { broadcastHandler } = ChromeUtils.import(
|
||||
"resource://test/broadcast_handler.jsm"
|
||||
);
|
||||
|
||||
const broadcastService = pushBroadcastService;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
const { getCryptoParamsFromHeaders, PushCrypto } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PushCrypto.sys.mjs"
|
||||
const { getCryptoParamsFromHeaders, PushCrypto } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushCrypto.jsm"
|
||||
);
|
||||
|
||||
const REJECT_PADDING = { padding: "reject" };
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
Cu.importGlobalProperties(["crypto"]);
|
||||
|
||||
const { PushCrypto } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PushCrypto.sys.mjs"
|
||||
const { PushCrypto } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushCrypto.jsm"
|
||||
);
|
||||
|
||||
let from64 = v => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
const { PushRecord } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PushRecord.sys.mjs"
|
||||
const { PushRecord } = ChromeUtils.import(
|
||||
"resource://gre/modules/PushRecord.jsm"
|
||||
);
|
||||
|
||||
add_task(async function test_updateQuota() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
head = head.js head-http2.js
|
||||
# Push notifications and alarms are currently disabled on Android.
|
||||
skip-if = toolkit == 'android'
|
||||
support-files = broadcast_handler.sys.mjs
|
||||
support-files = broadcast_handler.jsm
|
||||
|
||||
[test_broadcast_success.js]
|
||||
[test_clear_forgetAboutSite.js]
|
||||
|
|
|
@ -1224,6 +1224,7 @@
|
|||
"resource://gre/modules/ImageObjectProcessor.jsm":
|
||||
"dom/manifest/ImageObjectProcessor.jsm",
|
||||
"resource://gre/modules/IndexedDB.jsm": "toolkit/modules/IndexedDB.jsm",
|
||||
"resource://gre/modules/IndexedDBHelper.jsm": "dom/base/IndexedDBHelper.jsm",
|
||||
"resource://gre/modules/InlineSpellChecker.jsm":
|
||||
"toolkit/modules/InlineSpellChecker.jsm",
|
||||
"resource://gre/modules/InlineSpellCheckerContent.jsm":
|
||||
|
@ -1390,6 +1391,20 @@
|
|||
"toolkit/components/extensions/ProxyChannelFilter.jsm",
|
||||
"resource://gre/modules/PurgeTrackerService.jsm":
|
||||
"toolkit/components/antitracking/PurgeTrackerService.jsm",
|
||||
"resource://gre/modules/Push.jsm": "dom/push/Push.jsm",
|
||||
"resource://gre/modules/PushBroadcastService.jsm":
|
||||
"dom/push/PushBroadcastService.jsm",
|
||||
"resource://gre/modules/PushComponents.jsm": "dom/push/PushComponents.jsm",
|
||||
"resource://gre/modules/PushCrypto.jsm": "dom/push/PushCrypto.jsm",
|
||||
"resource://gre/modules/PushDB.jsm": "dom/push/PushDB.jsm",
|
||||
"resource://gre/modules/PushRecord.jsm": "dom/push/PushRecord.jsm",
|
||||
"resource://gre/modules/PushService.jsm": "dom/push/PushService.jsm",
|
||||
"resource://gre/modules/PushServiceAndroidGCM.jsm":
|
||||
"dom/push/PushServiceAndroidGCM.jsm",
|
||||
"resource://gre/modules/PushServiceHttp2.jsm":
|
||||
"dom/push/PushServiceHttp2.jsm",
|
||||
"resource://gre/modules/PushServiceWebSocket.jsm":
|
||||
"dom/push/PushServiceWebSocket.jsm",
|
||||
"resource://gre/modules/RFPHelper.jsm":
|
||||
"toolkit/components/resistfingerprinting/RFPHelper.jsm",
|
||||
"resource://gre/modules/ReaderMode.jsm":
|
||||
|
|
Загрузка…
Ссылка в новой задаче