michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "domstubs.idl" michael@0: michael@0: interface nsITCPSocketInternal; michael@0: interface nsIDOMWindow; michael@0: michael@0: // Interface to allow the content process socket to reach the IPC bridge. michael@0: // Implemented in C++ as TCPSocketChild, referenced as _socketBridge in TCPSocket.js michael@0: [scriptable, uuid(292ebb3a-beac-4e06-88b0-b5b4e88ebd1c)] michael@0: interface nsITCPSocketChild : nsISupports michael@0: { michael@0: // Tell the chrome process to open a corresponding connection with the given parameters michael@0: [implicit_jscontext] michael@0: void sendOpen(in nsITCPSocketInternal socket, in DOMString host, michael@0: in unsigned short port, in boolean ssl, in DOMString binaryType, michael@0: in nsIDOMWindow window, in jsval windowVal); michael@0: michael@0: // Tell the chrome process to perform send and update the tracking number. michael@0: [implicit_jscontext] michael@0: void sendSend(in jsval data, in unsigned long byteOffset, michael@0: in unsigned long byteLength, in unsigned long trackingNumber); michael@0: michael@0: // Tell the chrome process to perform equivalent operations to all following methods michael@0: void sendResume(); michael@0: void sendSuspend(); michael@0: void sendClose(); michael@0: void sendStartTLS(); michael@0: michael@0: /** michael@0: * Initialize the TCP socket on the child side for IPC. It is called from the child side, michael@0: * which is generated in receiving a notification of accepting any open request michael@0: * on the parent side. We use single implementation that works on a child process michael@0: * as well as in the single process model. michael@0: * michael@0: * @param socket michael@0: * The TCP socket on the child side. michael@0: * This instance is connected with the child IPC side of the IPC bridge. michael@0: * @param windowVal michael@0: * The window object on the child side to create data michael@0: * as "jsval" for deserialization. michael@0: */ michael@0: [implicit_jscontext] michael@0: void setSocketAndWindow(in nsITCPSocketInternal socket, in jsval windowVal); michael@0: };