dom/network/src/PTCPSocket.ipdl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
     4 /* This Source Code Form is subject to the terms of the Mozilla Public
     5  * License, v. 2.0. If a copy of the MPL was not distributed with this
     6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     8 include protocol PNecko;
    10 include "mozilla/net/NeckoMessageUtils.h";
    12 using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
    14 struct TCPError {
    15   nsString name;
    16 };
    18 union SendableData {
    19   uint8_t[];
    20   nsString;
    21 };
    23 union CallbackData {
    24   void_t;
    25   SendableData;
    26   TCPError;
    27 };
    29 namespace mozilla {
    30 namespace net {
    32 //-------------------------------------------------------------------
    33 protocol PTCPSocket
    34 {
    35   manager PNecko;
    37 parent:
    38   // Forward calling to child's open() method to parent, expect TCPOptions
    39   // is expanded to |useSSL| (from TCPOptions.useSecureTransport) and
    40   // |binaryType| (from TCPOption.binaryType).
    41   Open(nsString host, uint16_t port, bool useSSL, nsString binaryType);
    43   // When child's send() is called, this message requrests parent to send
    44   // data and update it's trackingNumber.
    45   Data(SendableData data, uint32_t trackingNumber);
    47   // Forward calling to child's upgradeToSecure() method to parent.
    48   StartTLS();
    50   // Forward calling to child's send() method to parent.
    51   Suspend();
    53   // Forward calling to child's resume() method to parent.
    54   Resume();
    56   // Forward calling to child's close() method to parent.
    57   Close();
    59 child:
    60   // Forward events that are dispatched by parent.
    61   Callback(nsString type, CallbackData data, nsString readyState);
    63   // Update child's bufferedAmount when parent's bufferedAmount is updated.
    64   // trackingNumber is also passed back to child to ensure the bufferedAmount
    65   // is corresponding the last call to send().
    66   UpdateBufferedAmount(uint32_t bufferedAmount, uint32_t trackingNumber);
    68 both:
    69   RequestDelete();
    70   __delete__();
    71 };
    74 } // namespace net
    75 } // namespace mozilla

mercurial