dom/network/interfaces/nsITCPSocketChild.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/network/interfaces/nsITCPSocketChild.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     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 file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "domstubs.idl"
     1.9 +
    1.10 +interface nsITCPSocketInternal;
    1.11 +interface nsIDOMWindow;
    1.12 +
    1.13 +// Interface to allow the content process socket to reach the IPC bridge.
    1.14 +// Implemented in C++ as TCPSocketChild, referenced as _socketBridge in TCPSocket.js
    1.15 +[scriptable, uuid(292ebb3a-beac-4e06-88b0-b5b4e88ebd1c)]
    1.16 +interface nsITCPSocketChild : nsISupports
    1.17 +{
    1.18 +  // Tell the chrome process to open a corresponding connection with the given parameters
    1.19 +  [implicit_jscontext]
    1.20 +  void sendOpen(in nsITCPSocketInternal socket, in DOMString host,
    1.21 +                in unsigned short port, in boolean ssl, in DOMString binaryType,
    1.22 +                in nsIDOMWindow window, in jsval windowVal);
    1.23 +
    1.24 +  // Tell the chrome process to perform send and update the tracking number.
    1.25 +  [implicit_jscontext] 
    1.26 +  void sendSend(in jsval data, in unsigned long byteOffset,
    1.27 +                in unsigned long byteLength, in unsigned long trackingNumber);
    1.28 +
    1.29 +  // Tell the chrome process to perform equivalent operations to all following methods
    1.30 +  void sendResume();
    1.31 +  void sendSuspend();
    1.32 +  void sendClose();
    1.33 +  void sendStartTLS();
    1.34 +
    1.35 +  /**
    1.36 +   * Initialize the TCP socket on the child side for IPC. It is called from the child side,
    1.37 +   * which is generated in receiving a notification of accepting any open request
    1.38 +   * on the parent side. We use single implementation that works on a child process 
    1.39 +   * as well as in the single process model.
    1.40 +   *
    1.41 +   * @param socket
    1.42 +   *        The TCP socket on the child side.
    1.43 +   *        This instance is connected with the child IPC side of the IPC bridge.
    1.44 +   * @param windowVal
    1.45 +   *        The window object on the child side to create data
    1.46 +   *        as "jsval" for deserialization.
    1.47 +   */
    1.48 +  [implicit_jscontext]
    1.49 +  void setSocketAndWindow(in nsITCPSocketInternal socket, in jsval windowVal);
    1.50 +};

mercurial