tor-browser

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

RTCPeerConnectionStatic.webidl (1584B)


      1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      4 * You can obtain one at http://mozilla.org/MPL/2.0/.
      5 */
      6 
      7 /*
      8  Right now, it is not possible to add static functions to a JS implemented
      9  interface (see bug 863952), so we need to create a simple interface with a
     10  trivial constructor and no data to hold these functions that really ought to
     11  be static in RTCPeerConnection.
     12  TODO(bcampen@mozilla.com) Merge this code into RTCPeerConnection once this
     13  limitation is gone. (Bug 1017082)
     14 */
     15 
     16 enum RTCLifecycleEvent {
     17    "initialized",
     18    "icegatheringstatechange",
     19    "iceconnectionstatechange",
     20    "connectionstatechange",
     21 };
     22 
     23 callback PeerConnectionLifecycleCallback = undefined (RTCPeerConnection pc,
     24                                                      unsigned long long windowId,
     25                                                      RTCLifecycleEvent eventType);
     26 
     27 [ChromeOnly,
     28 Pref="media.peerconnection.enabled",
     29 JSImplementation="@mozilla.org/dom/peerconnectionstatic;1",
     30 Exposed=Window]
     31 interface RTCPeerConnectionStatic {
     32  [Throws]
     33  constructor();
     34 
     35  /* One slot per window (the window in which the register call is made),
     36     automatically unregistered when window goes away.
     37     Fires when a PC is created, and whenever the ICE connection state or
     38     gathering state changes. */
     39  undefined registerPeerConnectionLifecycleCallback(
     40    PeerConnectionLifecycleCallback cb);
     41 };