Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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