2012-09-24 11:53:49 -07: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;
|
2013-07-29 10:36:43 -07:00
|
|
|
include protocol PBrowser;
|
2012-09-24 11:53:49 -07:00
|
|
|
|
|
|
|
include "mozilla/net/NeckoMessageUtils.h";
|
|
|
|
|
|
|
|
using mozilla::void_t;
|
|
|
|
|
2013-05-02 00:51:54 -07:00
|
|
|
struct TCPError {
|
|
|
|
nsString name;
|
2012-09-24 11:53:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
union SendableData {
|
|
|
|
uint8_t[];
|
|
|
|
nsString;
|
|
|
|
};
|
|
|
|
|
|
|
|
union CallbackData {
|
|
|
|
void_t;
|
|
|
|
SendableData;
|
2013-05-02 00:51:54 -07:00
|
|
|
TCPError;
|
2012-09-24 11:53:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
protocol PTCPSocket
|
|
|
|
{
|
|
|
|
manager PNecko;
|
|
|
|
|
|
|
|
parent:
|
2013-07-29 10:36:43 -07:00
|
|
|
Open(nsString host, uint16_t port, bool useSSL, nsString binaryType,
|
|
|
|
nullable PBrowser browser);
|
2012-09-24 11:53:49 -07:00
|
|
|
Data(SendableData data);
|
|
|
|
Suspend();
|
|
|
|
Resume();
|
|
|
|
Close();
|
|
|
|
|
|
|
|
child:
|
|
|
|
Callback(nsString type, CallbackData data,
|
|
|
|
nsString readyState, uint32_t bufferedAmount);
|
2013-07-29 10:36:43 -07:00
|
|
|
|
|
|
|
both:
|
|
|
|
RequestDelete();
|
2012-09-24 11:53:49 -07:00
|
|
|
__delete__();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|