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 * 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. 10 */ 11 12[Constructor(DOMString type, optional TCPSocketEventInit eventInitDict), 13 Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", 14 Exposed=(Window,System)] 15interface TCPSocketEvent : Event { 16 /** 17 * If the event is a "data" event, data will be the bytes read from the network; 18 * if the binaryType of the socket was "arraybuffer", this value will be of type 19 * ArrayBuffer, otherwise, it will be a ByteString. 20 * 21 * For other events, data will be an empty string. 22 */ 23 //TODO: make this (ArrayBuffer or ByteString) after sorting out the rooting required. (bug 1121634) 24 readonly attribute any data; 25}; 26 27dictionary TCPSocketEventInit : EventInit { 28 //TODO: make this (ArrayBuffer or ByteString) after sorting out the rooting required. (bug 1121634) 29 any data = null; 30}; 31