Bug 1891710: part 2) Enable <Element-outerHTML.html> WPT for Trusted Types. r=smaug
[gecko.git] / devtools / shared / specs / root.js
blobf48f3b62629c265731325ac7151cec98bfa03ac9
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 "use strict";
6 const {
7   types,
8   generateActorSpec,
9   RetVal,
10   Arg,
11   Option,
12 } = require("resource://devtools/shared/protocol.js");
14 types.addDictType("root.listWorkers", {
15   workers: "array:workerDescriptor",
16 });
17 types.addDictType("root.listServiceWorkerRegistrations", {
18   registrations: "array:serviceWorkerRegistration",
19 });
21 const rootSpecPrototype = {
22   typeName: "root",
24   methods: {
25     getRoot: {
26       request: {},
27       response: RetVal("json"),
28     },
30     listTabs: {
31       request: {},
32       response: {
33         tabs: RetVal("array:tabDescriptor"),
34       },
35     },
37     getTab: {
38       request: {
39         browserId: Option(0, "number"),
40       },
41       response: {
42         tab: RetVal("tabDescriptor"),
43       },
44     },
46     listAddons: {
47       request: {
48         iconDataURL: Option(0, "boolean"),
49       },
50       response: {
51         addons: RetVal("array:webExtensionDescriptor"),
52       },
53     },
55     listWorkers: {
56       request: {},
57       response: RetVal("root.listWorkers"),
58     },
60     listServiceWorkerRegistrations: {
61       request: {},
62       response: RetVal("root.listServiceWorkerRegistrations"),
63     },
65     listProcesses: {
66       request: {},
67       response: {
68         processes: RetVal("array:processDescriptor"),
69       },
70     },
72     getProcess: {
73       request: {
74         id: Arg(0, "number"),
75       },
76       response: {
77         processDescriptor: RetVal("processDescriptor"),
78       },
79     },
81     watchResources: {
82       request: {
83         resourceTypes: Arg(0, "array:string"),
84       },
85       response: {},
86     },
88     unwatchResources: {
89       request: {
90         resourceTypes: Arg(0, "array:string"),
91       },
92       oneway: true,
93     },
95     clearResources: {
96       request: {
97         resourceTypes: Arg(0, "array:string"),
98       },
99       oneway: true,
100     },
102     requestTypes: {
103       request: {},
104       response: RetVal("json"),
105     },
106   },
108   events: {
109     tabListChanged: {
110       type: "tabListChanged",
111     },
112     workerListChanged: {
113       type: "workerListChanged",
114     },
115     addonListChanged: {
116       type: "addonListChanged",
117     },
118     serviceWorkerRegistrationListChanged: {
119       type: "serviceWorkerRegistrationListChanged",
120     },
121     processListChanged: {
122       type: "processListChanged",
123     },
125     "resource-available-form": {
126       type: "resource-available-form",
127       resources: Arg(0, "array:json"),
128     },
129     "resource-destroyed-form": {
130       type: "resource-destroyed-form",
131       resources: Arg(0, "array:json"),
132     },
133   },
136 const rootSpec = generateActorSpec(rootSpecPrototype);
138 exports.rootSpecPrototype = rootSpecPrototype;
139 exports.rootSpec = rootSpec;