Bug 1857841 - pt 3. Add a new page kind named "fresh" r=glandium
[gecko.git] / dom / network / PTCPSocket.ipdl
blobc255408dd75eeb6bf11e220e61833f24ff9b6f5b
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";
11 include "mozilla/dom/network/TCPSocketParent.h";
12 include "mozilla/dom/network/TCPSocketChild.h";
14 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
16 struct TCPError {
17   nsString name;
18   nsString message;
19   nsresult errorCode;
22 union SendableData {
23   uint8_t[];
24   nsCString;
27 union CallbackData {
28   void_t;
29   SendableData;
30   TCPError;
33 namespace mozilla {
34 namespace net {
36 //-------------------------------------------------------------------
37 [ManualDealloc, ChildImpl="mozilla::dom::TCPSocketChild", ParentImpl="mozilla::dom::TCPSocketParent"]
38 protocol PTCPSocket
40   manager PNecko;
42 parent:
43   // Forward calling to child's open() method to parent, expect TCPOptions
44   // is expanded to |useSSL| (from TCPOptions.useSecureTransport) and
45   // |binaryType| (from TCPOption.binaryType).
46   async Open(nsString host, uint16_t port, bool useSSL, bool useArrayBuffers);
48   async Data(SendableData data);
50   // Forward calling to child's upgradeToSecure() method to parent.
51   async StartTLS();
53   // Forward calling to child's send() method to parent.
54   async Suspend();
56   // Forward calling to child's resume() method to parent.
57   async Resume();
59   // Forward calling to child's close() method to parent.
60   async Close();
62 child:
63   // Forward events that are dispatched by parent.
64   async Callback(nsString type, CallbackData data, uint32_t readyState);
66   // Update child's bufferedAmount when parent's bufferedAmount is updated.
67   // trackingNumber is also passed back to child to ensure the bufferedAmount
68   // is corresponding the last call to send().
69   async UpdateBufferedAmount(uint32_t bufferedAmount, uint32_t trackingNumber);
71 both:
72   async RequestDelete();
73   async __delete__();
77 } // namespace net
78 } // namespace mozilla