Bug 1472491: Part 5κ - Add ManifestMessagesChild actor. r=mconley

MozReview-Commit-ID: 20toouW9YzT

--HG--
rename : dom/ipc/ManifestMessages.jsm => dom/ipc/ManifestMessagesChild.jsm
extra : rebase_source : 204b5e01e5a2bd15a077e763e27155016c886818
This commit is contained in:
Kris Maglione 2018-07-30 11:39:52 -07:00
Родитель 3cdcc6d6af
Коммит 2ab798f156
4 изменённых файлов: 17 добавлений и 18 удалений

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

@ -25,12 +25,6 @@ var global = this;
XPCOMUtils.defineLazyProxy(this, "LightweightThemeChildHelper",
"resource:///modules/LightweightThemeChildHelper.jsm");
XPCOMUtils.defineLazyProxy(this, "ManifestMessages", () => {
let tmp = {};
ChromeUtils.import("resource://gre/modules/ManifestMessages.jsm", tmp);
return new tmp.ManifestMessages(global);
});
let themeablePagesWhitelist = new Set([
"about:home",
"about:newtab",
@ -92,8 +86,3 @@ addEventListener("MozAfterPaint", function onFirstNonBlankPaint() {
removeEventListener("MozAfterPaint", onFirstNonBlankPaint);
sendAsyncMessage("Browser:FirstNonBlankPaint");
});
addMessageListener("DOM:WebManifest:hasManifestLink", ManifestMessages);
addMessageListener("DOM:ManifestObtainer:Obtain", ManifestMessages);
addMessageListener("DOM:Manifest:FireAppInstalledEvent", ManifestMessages);
addMessageListener("DOM:WebManifest:fetchIcon", ManifestMessages);

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

@ -13,8 +13,9 @@
*/
"use strict";
var EXPORTED_SYMBOLS = ["ManifestMessages"];
var EXPORTED_SYMBOLS = ["ManifestMessagesChild"];
ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "ManifestObtainer",
@ -24,11 +25,7 @@ ChromeUtils.defineModuleGetter(this, "ManifestFinder",
ChromeUtils.defineModuleGetter(this, "ManifestIcons",
"resource://gre/modules/ManifestIcons.jsm");
class ManifestMessages {
constructor(mm) {
this.mm = mm;
}
class ManifestMessagesChild extends ActorChild {
receiveMessage(message) {
switch (message.name) {
case "DOM:WebManifest:hasManifestLink":

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

@ -14,7 +14,7 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'dom'
EXTRA_JS_MODULES += [
'ManifestMessages.jsm',
'ManifestMessagesChild.jsm',
]
EXPORTS.mozilla.dom.ipc += [

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

@ -140,6 +140,19 @@ let ACTORS = {
},
},
ManifestMessages: {
child: {
module: "resource://gre/modules/ManifestMessagesChild.jsm",
group: "browsers",
messages: [
"DOM:Manifest:FireAppInstalledEvent",
"DOM:ManifestObtainer:Obtain",
"DOM:WebManifest:fetchIcon",
"DOM:WebManifest:hasManifestLink",
],
},
},
PopupBlocking: {
child: {
module: "resource://gre/actors/PopupBlockingChild.jsm",