1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/DataChannel.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,48 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +enum RTCDataChannelState { 1.9 + "connecting", 1.10 + "open", 1.11 + "closing", 1.12 + "closed" 1.13 +}; 1.14 + 1.15 +enum RTCDataChannelType { 1.16 + "arraybuffer", 1.17 + "blob" 1.18 +}; 1.19 + 1.20 +// XXX This interface is called RTCDataChannel in the spec. 1.21 +interface DataChannel : EventTarget 1.22 +{ 1.23 + readonly attribute DOMString label; 1.24 + readonly attribute boolean reliable; 1.25 + readonly attribute RTCDataChannelState readyState; 1.26 + readonly attribute unsigned long bufferedAmount; 1.27 + attribute EventHandler onopen; 1.28 + attribute EventHandler onerror; 1.29 + attribute EventHandler onclose; 1.30 + void close(); 1.31 + attribute EventHandler onmessage; 1.32 + attribute RTCDataChannelType binaryType; 1.33 + [Throws] 1.34 + void send(DOMString data); 1.35 + [Throws] 1.36 + void send(Blob data); 1.37 + [Throws] 1.38 + void send(ArrayBuffer data); 1.39 + [Throws] 1.40 + void send(ArrayBufferView data); 1.41 +}; 1.42 + 1.43 +// Mozilla extensions. 1.44 +partial interface DataChannel 1.45 +{ 1.46 + readonly attribute DOMString protocol; 1.47 + readonly attribute boolean ordered; 1.48 + readonly attribute unsigned short id; 1.49 + // this is deprecated due to renaming in the spec, but still supported for Fx22 1.50 + readonly attribute unsigned short stream; // now id 1.51 +};