From 2aa4a82499d4becd2284cdb482213d541b8804dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:10 +0200 Subject: Adding upstream version 86.0.1. Signed-off-by: Daniel Baumann --- devtools/shared/specs/descriptors/moz.build | 12 +++++++ devtools/shared/specs/descriptors/process.js | 25 ++++++++++++++ devtools/shared/specs/descriptors/tab.js | 31 ++++++++++++++++++ devtools/shared/specs/descriptors/webextension.js | 30 +++++++++++++++++ devtools/shared/specs/descriptors/worker.js | 40 +++++++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 devtools/shared/specs/descriptors/moz.build create mode 100644 devtools/shared/specs/descriptors/process.js create mode 100644 devtools/shared/specs/descriptors/tab.js create mode 100644 devtools/shared/specs/descriptors/webextension.js create mode 100644 devtools/shared/specs/descriptors/worker.js (limited to 'devtools/shared/specs/descriptors') 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; -- cgit v1.2.3