tor-browser

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

BrowserProcessChild.sys.mjs (1122B)


      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 
      5 const lazy = {};
      6 
      7 ChromeUtils.defineESModuleGetters(lazy, {
      8  AboutHomeStartupCacheChild:
      9    "resource:///modules/AboutNewTabRedirector.sys.mjs",
     10  WebRTCChild: "resource:///actors/WebRTCChild.sys.mjs",
     11 });
     12 
     13 export class BrowserProcessChild extends JSProcessActorChild {
     14  receiveMessage(message) {
     15    switch (message.name) {
     16      case "AboutHomeStartupCache:InputStreams": {
     17        let { pageInputStream, scriptInputStream } = message.data;
     18        lazy.AboutHomeStartupCacheChild.init(
     19          pageInputStream,
     20          scriptInputStream
     21        );
     22        break;
     23      }
     24    }
     25  }
     26 
     27  observe(subject, topic, data) {
     28    switch (topic) {
     29      case "getUserMedia:request":
     30      case "recording-device-stopped":
     31      case "PeerConnection:request":
     32      case "recording-device-events":
     33      case "recording-window-ended":
     34        lazy.WebRTCChild.observe(subject, topic, data);
     35        break;
     36    }
     37  }
     38 }