tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

content-process.js (1307B)


      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";
      5 
      6 const {
      7  types,
      8  Arg,
      9  Option,
     10  RetVal,
     11  generateActorSpec,
     12 } = require("resource://devtools/shared/protocol.js");
     13 
     14 types.addDictType("contentProcessTarget.workers", {
     15  error: "nullable:string",
     16  workers: "nullable:array:workerDescriptor",
     17 });
     18 
     19 const contentProcessTargetSpec = generateActorSpec({
     20  typeName: "contentProcessTarget",
     21 
     22  methods: {
     23    listWorkers: {
     24      request: {},
     25      response: RetVal("contentProcessTarget.workers"),
     26    },
     27 
     28    pauseMatchingServiceWorkers: {
     29      request: {
     30        origin: Option(0, "string"),
     31      },
     32      response: {},
     33    },
     34  },
     35 
     36  events: {
     37    workerListChanged: {
     38      type: "workerListChanged",
     39    },
     40 
     41    "resources-available-array": {
     42      type: "resources-available-array",
     43      array: Arg(0, "array:json"),
     44    },
     45    "resources-destroyed-array": {
     46      type: "resources-destroyed-array",
     47      array: Arg(0, "array:json"),
     48    },
     49    "resources-updated-array": {
     50      type: "resources-updated-array",
     51      array: Arg(0, "array:json"),
     52    },
     53  },
     54 });
     55 
     56 exports.contentProcessTargetSpec = contentProcessTargetSpec;