diff options
Diffstat (limited to '')
-rw-r--r-- | devtools/shared/specs/descriptors/moz.build | 12 | ||||
-rw-r--r-- | devtools/shared/specs/descriptors/process.js | 25 | ||||
-rw-r--r-- | devtools/shared/specs/descriptors/tab.js | 31 | ||||
-rw-r--r-- | devtools/shared/specs/descriptors/webextension.js | 30 | ||||
-rw-r--r-- | devtools/shared/specs/descriptors/worker.js | 40 |
5 files changed, 138 insertions, 0 deletions
diff --git a/devtools/shared/specs/descriptors/moz.build b/devtools/shared/specs/descriptors/moz.build new file mode 100644 index 0000000000..bf297b3dcb --- /dev/null +++ b/devtools/shared/specs/descriptors/moz.build @@ -0,0 +1,12 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +DevToolsModules( + "process.js", + "tab.js", + "webextension.js", + "worker.js", +) diff --git a/devtools/shared/specs/descriptors/process.js b/devtools/shared/specs/descriptors/process.js new file mode 100644 index 0000000000..402552919a --- /dev/null +++ b/devtools/shared/specs/descriptors/process.js @@ -0,0 +1,25 @@ +/* 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"), + }, + }, +}); + +exports.processDescriptorSpec = processDescriptorSpec; diff --git a/devtools/shared/specs/descriptors/tab.js b/devtools/shared/specs/descriptors/tab.js new file mode 100644 index 0000000000..f767468236 --- /dev/null +++ b/devtools/shared/specs/descriptors/tab.js @@ -0,0 +1,31 @@ +/* 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 tabDescriptorSpec = generateActorSpec({ + typeName: "tabDescriptor", + + methods: { + getTarget: { + request: {}, + response: { + frame: RetVal("json"), + }, + }, + getFavicon: { + request: {}, + response: { + favicon: RetVal("string"), + }, + }, + getWatcher: { + request: {}, + response: RetVal("watcher"), + }, + }, +}); + +exports.tabDescriptorSpec = tabDescriptorSpec; diff --git a/devtools/shared/specs/descriptors/webextension.js b/devtools/shared/specs/descriptors/webextension.js new file mode 100644 index 0000000000..60ab47494d --- /dev/null +++ b/devtools/shared/specs/descriptors/webextension.js @@ -0,0 +1,30 @@ +/* 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 { RetVal, generateActorSpec } = require("devtools/shared/protocol"); + +const webExtensionDescriptorSpec = generateActorSpec({ + typeName: "webExtensionDescriptor", + + methods: { + reload: { + request: {}, + response: { addon: RetVal("json") }, + }, + + // @backward-compat { version 70 } The method is now called getTarget + connect: { + request: {}, + response: { form: RetVal("json") }, + }, + + getTarget: { + request: {}, + response: { form: RetVal("json") }, + }, + }, +}); + +exports.webExtensionDescriptorSpec = webExtensionDescriptorSpec; diff --git a/devtools/shared/specs/descriptors/worker.js b/devtools/shared/specs/descriptors/worker.js new file mode 100644 index 0000000000..12b942730f --- /dev/null +++ b/devtools/shared/specs/descriptors/worker.js @@ -0,0 +1,40 @@ +/* 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 { RetVal, generateActorSpec } = require("devtools/shared/protocol"); + +const workerDescriptorSpec = generateActorSpec({ + typeName: "workerDescriptor", + + methods: { + attach: { + request: {}, + response: RetVal("json"), + }, + detach: { + request: {}, + response: RetVal("json"), + }, + getTarget: { + request: {}, + response: RetVal("json"), + }, + push: { + request: {}, + response: RetVal("json"), + }, + }, + + events: { + // WorkerDescriptorActor still uses old sendActorEvent function, + // but it should use emit instead. + // Do not emit a `close` event as Target class emit this event on destroy + "worker-close": { + type: "close", + }, + }, +}); + +exports.workerDescriptorSpec = workerDescriptorSpec; |