gecko-dev/devtools/server/content-process-debugger-server.js
Julian Descottes 9bedf05e44 Bug 1364075 - remove DevTools dependency in ContentProcessSingleton;r=ochameau
MozReview-Commit-ID: 38XKKM37jC5

--HG--
extra : rebase_source : 65b3aced59a7f5ceca35b2941c1ab1c80ac89b2b
2017-05-29 23:36:26 +02:00

27 lines
918 B
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* global addMessageListener, removeMessageListener */
"use strict";
const { utils: Cu } = Components;
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
function onInit(message) {
// Only reply if we are in a real content process
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
let {init} = Cu.import("resource://devtools/server/content-server.jsm", {});
init(message);
}
}
function onClose() {
removeMessageListener("debug:init-content-server", onInit);
removeMessageListener("debug:close-content-server", onClose);
}
addMessageListener("debug:init-content-server", onInit);
addMessageListener("debug:close-content-server", onClose);