fune/devtools/shared/specs/descriptors/process.js
Alexandre Poirot 10191d836c Bug 1695929 - [devtools] Emit descriptor-destroyed on all descriptor actor when their related context is closed/destroyed. r=jdescottes,devtools-backward-compat-reviewers,nchevobbe
This will help close the toolbox and client only when the tab closes.
We no longer have to workaround target switching.
It also helps making "worker-close" event less special.

Differential Revision: https://phabricator.services.mozilla.com/D107063
2021-03-09 08:56:58 +00:00

31 lines
731 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/. */
"use strict";
const { generateActorSpec, RetVal } = require("devtools/shared/protocol");
const processDescriptorSpec = generateActorSpec({
typeName: "processDescriptor",
methods: {
getTarget: {
request: {},
response: {
process: RetVal("json"),
},
},
getWatcher: {
request: {},
response: RetVal("watcher"),
},
},
events: {
"descriptor-destroyed": {
type: "descriptor-destroyed",
},
},
});
exports.processDescriptorSpec = processDescriptorSpec;