2012-09-24 22:53:49 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
|
|
|
|
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
include protocol PNecko;
|
|
|
|
|
|
|
|
include "mozilla/net/NeckoMessageUtils.h";
|
|
|
|
|
2013-10-01 23:25:07 +04:00
|
|
|
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
|
2012-09-24 22:53:49 +04:00
|
|
|
|
2013-05-02 11:51:54 +04:00
|
|
|
struct TCPError {
|
|
|
|
nsString name;
|
2015-03-25 17:36:56 +03:00
|
|
|
nsString message;
|
2012-09-24 22:53:49 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
union SendableData {
|
|
|
|
uint8_t[];
|
2015-03-25 17:36:56 +03:00
|
|
|
nsCString;
|
2012-09-24 22:53:49 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
union CallbackData {
|
|
|
|
void_t;
|
|
|
|
SendableData;
|
2013-05-02 11:51:54 +04:00
|
|
|
TCPError;
|
2012-09-24 22:53:49 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
protocol PTCPSocket
|
|
|
|
{
|
|
|
|
manager PNecko;
|
|
|
|
|
|
|
|
parent:
|
2013-11-14 11:59:55 +04:00
|
|
|
// Forward calling to child's open() method to parent, expect TCPOptions
|
|
|
|
// is expanded to |useSSL| (from TCPOptions.useSecureTransport) and
|
|
|
|
// |binaryType| (from TCPOption.binaryType).
|
2016-01-27 00:51:53 +03:00
|
|
|
async Open(nsString host, uint16_t port, bool useSSL, bool useArrayBuffers);
|
2013-11-14 11:59:55 +04:00
|
|
|
|
2015-01-05 10:49:24 +03:00
|
|
|
// Ask parent to open a socket and bind the newly-opened socket to a local
|
|
|
|
// address specified in |localAddr| and |localPort|.
|
2016-01-27 00:51:53 +03:00
|
|
|
async OpenBind(nsCString host, uint16_t port,
|
|
|
|
nsCString localAddr, uint16_t localPort,
|
2016-12-22 10:38:06 +03:00
|
|
|
bool useSSL, bool reuseAddrPort,
|
|
|
|
bool aUseArrayBuffers, nsCString aFilter);
|
2015-01-05 10:49:24 +03:00
|
|
|
|
2013-11-14 12:00:28 +04:00
|
|
|
// When child's send() is called, this message requrests parent to send
|
|
|
|
// data and update it's trackingNumber.
|
2016-01-27 00:51:53 +03:00
|
|
|
async Data(SendableData data, uint32_t trackingNumber);
|
2013-11-14 11:59:55 +04:00
|
|
|
|
|
|
|
// Forward calling to child's upgradeToSecure() method to parent.
|
2016-01-27 00:51:53 +03:00
|
|
|
async StartTLS();
|
2013-11-14 11:59:55 +04:00
|
|
|
|
|
|
|
// Forward calling to child's send() method to parent.
|
2016-01-27 00:51:53 +03:00
|
|
|
async Suspend();
|
2013-11-14 11:59:55 +04:00
|
|
|
|
|
|
|
// Forward calling to child's resume() method to parent.
|
2016-01-27 00:51:53 +03:00
|
|
|
async Resume();
|
2013-11-14 11:59:55 +04:00
|
|
|
|
|
|
|
// Forward calling to child's close() method to parent.
|
2016-01-27 00:51:53 +03:00
|
|
|
async Close();
|
2012-09-24 22:53:49 +04:00
|
|
|
|
|
|
|
child:
|
2013-11-14 11:59:55 +04:00
|
|
|
// Forward events that are dispatched by parent.
|
2016-01-27 00:51:53 +03:00
|
|
|
async Callback(nsString type, CallbackData data, uint32_t readyState);
|
2013-11-14 12:00:28 +04:00
|
|
|
|
|
|
|
// Update child's bufferedAmount when parent's bufferedAmount is updated.
|
|
|
|
// trackingNumber is also passed back to child to ensure the bufferedAmount
|
|
|
|
// is corresponding the last call to send().
|
2016-01-27 00:51:53 +03:00
|
|
|
async UpdateBufferedAmount(uint32_t bufferedAmount, uint32_t trackingNumber);
|
2013-07-29 21:36:43 +04:00
|
|
|
|
|
|
|
both:
|
2016-01-27 00:51:53 +03:00
|
|
|
async RequestDelete();
|
|
|
|
async __delete__();
|
2012-09-24 22:53:49 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|