summaryrefslogtreecommitdiffstats
path: root/devtools/shared/specs/descriptors
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /devtools/shared/specs/descriptors
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/shared/specs/descriptors')
-rw-r--r--devtools/shared/specs/descriptors/moz.build12
-rw-r--r--devtools/shared/specs/descriptors/process.js25
-rw-r--r--devtools/shared/specs/descriptors/tab.js31
-rw-r--r--devtools/shared/specs/descriptors/webextension.js30
-rw-r--r--devtools/shared/specs/descriptors/worker.js40
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;