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/. */
7 * TCPSocketEvent is the event dispatched for all of the events described by TCPSocket,
8 * except the "error" event. It contains the socket that was associated with the event,
9 * the type of event, and the data associated with the event if the event is a "data" event.
12 [Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist",
14 interface TCPSocketEvent : Event {
15 constructor(DOMString type, optional TCPSocketEventInit eventInitDict = {});
18 * If the event is a "data" event, data will be the bytes read from the network;
19 * if the binaryType of the socket was "arraybuffer", this value will be of type
20 * ArrayBuffer, otherwise, it will be a ByteString.
22 * For other events, data will be an empty string.
24 //TODO: make this (ArrayBuffer or ByteString) after sorting out the rooting required. (bug 1121634)
25 readonly attribute any data;
28 dictionary TCPSocketEventInit : EventInit {
29 //TODO: make this (ArrayBuffer or ByteString) after sorting out the rooting required. (bug 1121634)