michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */ michael@0: 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 michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: include protocol PNecko; michael@0: michael@0: include "mozilla/net/NeckoMessageUtils.h"; michael@0: michael@0: using struct mozilla::void_t from "ipc/IPCMessageUtils.h"; michael@0: michael@0: struct TCPError { michael@0: nsString name; michael@0: }; michael@0: michael@0: union SendableData { michael@0: uint8_t[]; michael@0: nsString; michael@0: }; michael@0: michael@0: union CallbackData { michael@0: void_t; michael@0: SendableData; michael@0: TCPError; michael@0: }; michael@0: michael@0: namespace mozilla { michael@0: namespace net { michael@0: michael@0: //------------------------------------------------------------------- michael@0: protocol PTCPSocket michael@0: { michael@0: manager PNecko; michael@0: michael@0: parent: michael@0: // Forward calling to child's open() method to parent, expect TCPOptions michael@0: // is expanded to |useSSL| (from TCPOptions.useSecureTransport) and michael@0: // |binaryType| (from TCPOption.binaryType). michael@0: Open(nsString host, uint16_t port, bool useSSL, nsString binaryType); michael@0: michael@0: // When child's send() is called, this message requrests parent to send michael@0: // data and update it's trackingNumber. michael@0: Data(SendableData data, uint32_t trackingNumber); michael@0: michael@0: // Forward calling to child's upgradeToSecure() method to parent. michael@0: StartTLS(); michael@0: michael@0: // Forward calling to child's send() method to parent. michael@0: Suspend(); michael@0: michael@0: // Forward calling to child's resume() method to parent. michael@0: Resume(); michael@0: michael@0: // Forward calling to child's close() method to parent. michael@0: Close(); michael@0: michael@0: child: michael@0: // Forward events that are dispatched by parent. michael@0: Callback(nsString type, CallbackData data, nsString readyState); michael@0: michael@0: // Update child's bufferedAmount when parent's bufferedAmount is updated. michael@0: // trackingNumber is also passed back to child to ensure the bufferedAmount michael@0: // is corresponding the last call to send(). michael@0: UpdateBufferedAmount(uint32_t bufferedAmount, uint32_t trackingNumber); michael@0: michael@0: both: michael@0: RequestDelete(); michael@0: __delete__(); michael@0: }; michael@0: michael@0: michael@0: } // namespace net michael@0: } // namespace mozilla michael@0: