1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/network/src/PTCPSocket.ipdl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,76 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */ 1.6 + 1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 + 1.11 +include protocol PNecko; 1.12 + 1.13 +include "mozilla/net/NeckoMessageUtils.h"; 1.14 + 1.15 +using struct mozilla::void_t from "ipc/IPCMessageUtils.h"; 1.16 + 1.17 +struct TCPError { 1.18 + nsString name; 1.19 +}; 1.20 + 1.21 +union SendableData { 1.22 + uint8_t[]; 1.23 + nsString; 1.24 +}; 1.25 + 1.26 +union CallbackData { 1.27 + void_t; 1.28 + SendableData; 1.29 + TCPError; 1.30 +}; 1.31 + 1.32 +namespace mozilla { 1.33 +namespace net { 1.34 + 1.35 +//------------------------------------------------------------------- 1.36 +protocol PTCPSocket 1.37 +{ 1.38 + manager PNecko; 1.39 + 1.40 +parent: 1.41 + // Forward calling to child's open() method to parent, expect TCPOptions 1.42 + // is expanded to |useSSL| (from TCPOptions.useSecureTransport) and 1.43 + // |binaryType| (from TCPOption.binaryType). 1.44 + Open(nsString host, uint16_t port, bool useSSL, nsString binaryType); 1.45 + 1.46 + // When child's send() is called, this message requrests parent to send 1.47 + // data and update it's trackingNumber. 1.48 + Data(SendableData data, uint32_t trackingNumber); 1.49 + 1.50 + // Forward calling to child's upgradeToSecure() method to parent. 1.51 + StartTLS(); 1.52 + 1.53 + // Forward calling to child's send() method to parent. 1.54 + Suspend(); 1.55 + 1.56 + // Forward calling to child's resume() method to parent. 1.57 + Resume(); 1.58 + 1.59 + // Forward calling to child's close() method to parent. 1.60 + Close(); 1.61 + 1.62 +child: 1.63 + // Forward events that are dispatched by parent. 1.64 + Callback(nsString type, CallbackData data, nsString readyState); 1.65 + 1.66 + // Update child's bufferedAmount when parent's bufferedAmount is updated. 1.67 + // trackingNumber is also passed back to child to ensure the bufferedAmount 1.68 + // is corresponding the last call to send(). 1.69 + UpdateBufferedAmount(uint32_t bufferedAmount, uint32_t trackingNumber); 1.70 + 1.71 +both: 1.72 + RequestDelete(); 1.73 + __delete__(); 1.74 +}; 1.75 + 1.76 + 1.77 +} // namespace net 1.78 +} // namespace mozilla 1.79 +