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/.
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 mozRTCPeerConnection.
12 TODO(bcampen@mozilla.com) Merge this code into RTCPeerConnection once this
13 limitation is gone. (Bug 1017082)
16 enum RTCLifecycleEvent {
18 "icegatheringstatechange",
19 "iceconnectionstatechange"
22 callback PeerConnectionLifecycleCallback = void (mozRTCPeerConnection pc,
23 unsigned long long windowId,
24 RTCLifecycleEvent eventType);
27 Pref="media.peerconnection.enabled",
28 JSImplementation="@mozilla.org/dom/peerconnectionstatic;1",
30 interface mozRTCPeerConnectionStatic {
32 /* One slot per window (the window in which the register call is made),
33 automatically unregistered when window goes away.
34 Fires when a PC is created, and whenever the ICE connection state or
35 gathering state changes. */
36 void registerPeerConnectionLifecycleCallback(
37 PeerConnectionLifecycleCallback cb);