2012-09-24 18:53:49 +00: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 19:25:07 +00:00
|
|
|
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
|
2012-09-24 18:53:49 +00:00
|
|
|
|
2013-05-02 07:51:54 +00:00
|
|
|
struct TCPError {
|
|
|
|
nsString name;
|
2012-09-24 18:53:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
union SendableData {
|
|
|
|
uint8_t[];
|
|
|
|
nsString;
|
|
|
|
};
|
|
|
|
|
|
|
|
union CallbackData {
|
|
|
|
void_t;
|
|
|
|
SendableData;
|
2013-05-02 07:51:54 +00:00
|
|
|
TCPError;
|
2012-09-24 18:53:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
protocol PTCPSocket
|
|
|
|
{
|
|
|
|
manager PNecko;
|
|
|
|
|
|
|
|
parent:
|
2013-11-14 07:59:55 +00:00
|
|
|
// Forward calling to child's open() method to parent, expect TCPOptions
|
|
|
|
// is expanded to |useSSL| (from TCPOptions.useSecureTransport) and
|
|
|
|
// |binaryType| (from TCPOption.binaryType).
|
2013-08-21 06:49:42 +00:00
|
|
|
Open(nsString host, uint16_t port, bool useSSL, nsString binaryType);
|
2013-11-14 07:59:55 +00:00
|
|
|
|
2013-11-14 08:00:28 +00:00
|
|
|
// When child's send() is called, this message requrests parent to send
|
|
|
|
// data and update it's trackingNumber.
|
|
|
|
Data(SendableData data, uint32_t trackingNumber);
|
2013-11-14 07:59:55 +00:00
|
|
|
|
|
|
|
// Forward calling to child's upgradeToSecure() method to parent.
|
2013-08-31 19:09:17 +00:00
|
|
|
StartTLS();
|
2013-11-14 07:59:55 +00:00
|
|
|
|
|
|
|
// Forward calling to child's send() method to parent.
|
2012-09-24 18:53:49 +00:00
|
|
|
Suspend();
|
2013-11-14 07:59:55 +00:00
|
|
|
|
|
|
|
// Forward calling to child's resume() method to parent.
|
2012-09-24 18:53:49 +00:00
|
|
|
Resume();
|
2013-11-14 07:59:55 +00:00
|
|
|
|
|
|
|
// Forward calling to child's close() method to parent.
|
2012-09-24 18:53:49 +00:00
|
|
|
Close();
|
|
|
|
|
|
|
|
child:
|
2013-11-14 07:59:55 +00:00
|
|
|
// Forward events that are dispatched by parent.
|
2013-11-14 08:00:28 +00:00
|
|
|
Callback(nsString type, CallbackData data, nsString readyState);
|
|
|
|
|
|
|
|
// 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().
|
|
|
|
UpdateBufferedAmount(uint32_t bufferedAmount, uint32_t trackingNumber);
|
2013-07-29 17:36:43 +00:00
|
|
|
|
|
|
|
both:
|
|
|
|
RequestDelete();
|
2012-09-24 18:53:49 +00:00
|
|
|
__delete__();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|