Files
roytam1 5a6524c1db import changes from `dev' branch of rmottola/Arctic-Fox:
- partly import Bug 1201597 - Part 0: Make saveHeapSnapshot return the file path rather than take it as a parameter; r=bholley (85652707)
- partly import Bug 1201597 - Part 2: Add an IPDL subprotocol for opening core dump files to (f9c9b2b7)
- Bug 1184426 - Unprefix RTCIceCandidatePairStats.priority (formerly mozPriority). r=bwc, r=smaug (3381192783)
- Bug 1211793 - Remove unnecessary creation of "MediaDecoder" log module. r=gerald. (ed090bfe9c)
- Bug 1215532. Make sure the exposure set of the generated iterator interface matches that of the iterable it's created for, and that IterableIterator is exposed everywhere. r=qdot (d580e5a3dc)
- Bug 1215755. Change the Web IDL parser to just put a next() method initerator interfaces instead of using an additional IterableIterator interface. Fix up the other test failures in test_interface_maplikesetlikeiterable.py while I'm here. r=qdot (568f46851e)
- Bug 961329 - Implement JS::ubi::DominatorTree; r=sfink (b0cee6e886)
- Bug 1194991 - Part a: rewrite test_const.py to simplify adding new tests; r=khuey (510c69e81e)
- Bug 1194991 - Part b: coerce WebIDL constants to the correct type; r=khuey (8076a19ff9)
- Bug 1186142 - Make selector arg optional on PeerConnection.getStats(). r=bz (58041a2533)
- Bug 1215519 - Switch to DOMTimeStamp for RTCCertificate. r=bz (0bfba3a6ac)
- Bug 1152538 - RTCIdentityAssertion is a dictionary, r=smaug (b0c525ab44)
- Bug 1214867 - Add HeapSnapshot.prototype.creationTime; r=bholley (d533dfb5be)
- Bug 1225588 - Expose DominatorTree to JavaScript; r=sfink,bz (bed975d820)
- Bug 1223512 - Validate that every edge referent is in the heap snapshot; r=shu (170fdfac5e)
- Bug 1218597 - Limit the number of stack frames serialized in core dumps; r=froydnj (3d69d6515f)
- Bug 1153294 - Exposing Document.documentLoadGroup to Chrome JS, r=sicking (4b1f6fcfc3)
- Bug 1221292 - move nondeterministicGetWeakMapKeys to ThreadSafeChromeUtils; r=bz (7c528633b5)
- Bug 1223954 - don't use implicitJSContext for readHeapSnapshot and saveHeapSnapshot; r=bz (22f6ebf124)
- Bug 1204155 - Account for OOM in CryptoKey::SetSymKey() r=mt (d8e5713ad1)
- Bug 1204155 - Check if we're OOM when calling SECKEY_CopyPrivateKey() and SECKEY_CopyPublicKey() r=mt (8f1a9143ce)
- Bug 1001691 - Make GenerateAsymmetricKeyTask::mKeyPair a UniquePtr so that we can explicitly release it on the main thread r=mt (40fa47ffae)
- Bug 1213937 - Make WebRTC certificates SHA-256 only, r=drno (c1e3d2fd23)
- Bug 1158886 - Correct public key argument names for CryptoKey::PublicKeyToSpki() and ::PublicKeyToJwk() r=rbarnes (f70b95a51d)
- Bug 901698 - Implement OCSP-must-staple; r=keeler (4abe7c7616)
- Bug 1213203 - AsymmetricSignVerifyTask::DoCrypto() creates unused SGN Context r=mt (afef1029de)
- Bug 1188750 - CryptoKey::ReadStructuredClone() needs to ensure NSS is initialized before trying to deserialize a key r=keeler (12c4d54ece)
- Bug 1001691 - Implement WebCrypto thread pool r=bz (60cfa74a56)
- Bug 1001691 - Use thread pool for WebCrypto operations r=bz (dd61402a0c)
- Bug 1207090 - Expose TCPSocket to chrome contexts. r=bz (e17fd13133)
- Bug 1210330 - TCPSocket data event should be an ArrayBuffer in non-e10s case too. r=jdm (6bf1210377)
- Bug 1219476 (part 1) - Replace PRLogModuleInfo usage with LazyLogModule in gfx/. r=erahm. (da793ddf99)
- Bug 1219476 (part 2) - Replace PRLogModuleInfo usage with LazyLogModule in gfx/. r=erahm. (d87f0ea067)
- Bug 1219476 (part 3) - Replace PRLogModuleInfo usage with LazyLogModule in gfx/. r=erahm. (5715cffabf)
- Bug 1219476 (part 4) - Replace PRLogModuleInfo usage with LazyLogModule in gfx/. r=erahm. (7f203f36de)
- Bug 1219476 (part 5) - Replace PRLogModuleInfo usage with LazyLogModule in gfx/. r=erahm. (65d1438d2e)
- Bug 1211360 - Don't snap for non-translation 3D transform. r=roc (e11c2b9104)
- Bug 1198996 - Ensure layer local opacity is clamped to 0..1 range. r=Bas (9b90e4348a)
- Bug 1222661 - Replace ToUnknown(obj) and FromUnknown(obj) with obj.ToUnknown*() and FromUnknown*(obj). r=nical (6da1eeedab)
2023-01-12 11:55:54 +08:00

206 lines
7.1 KiB
Plaintext

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
/**
* TCPSocket exposes a TCP client socket (no server sockets yet)
* to highly privileged apps. It provides a buffered, non-blocking
* interface for sending. For receiving, it uses an asynchronous,
* event handler based interface.
*/
enum TCPSocketBinaryType {
"arraybuffer",
"string"
};
dictionary SocketOptions {
boolean useSecureTransport = false;
TCPSocketBinaryType binaryType = "string";
};
enum TCPReadyState {
"connecting",
"open",
"closing",
"closed",
};
[NoInterfaceObject]
interface LegacyMozTCPSocket {
/**
* Legacy constructor for API compatibility.
*/
[Throws]
TCPSocket open(DOMString host, unsigned short port, optional SocketOptions options);
[Throws]
TCPServerSocket listen(unsigned short port, optional ServerSocketOptions options, optional unsigned short backlog = 0);
};
[Constructor(DOMString host, unsigned short port, optional SocketOptions options),
Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist",
Exposed=(Window,System)]
interface TCPSocket : EventTarget {
/**
* Upgrade an insecure connection to use TLS. Throws if the ready state is not OPEN.
*/
[Throws] void upgradeToSecure();
/**
* The UTF16 host of this socket object.
*/
readonly attribute USVString host;
/**
* The port of this socket object.
*/
readonly attribute unsigned short port;
/**
* True if this socket object is an SSL socket.
*/
readonly attribute boolean ssl;
/**
* The number of bytes which have previously been buffered by calls to
* send on this socket.
*/
readonly attribute unsigned long long bufferedAmount;
/**
* Pause reading incoming data and invocations of the ondata handler until
* resume is called. Can be called multiple times without resuming.
*/
void suspend();
/**
* Resume reading incoming data and invoking ondata as usual. There must be
* an equal number of resume as suspends that took place. Throws if the
* socket is not suspended.
*/
[Throws]
void resume();
/**
* Close the socket.
*/
void close();
/**
* Write data to the socket.
*
* @param data The data to write to the socket.
*
* @return Send returns true or false as a hint to the caller that
* they may either continue sending more data immediately, or
* may want to wait until the other side has read some of the
* data which has already been written to the socket before
* buffering more. If send returns true, then less than 64k
* has been buffered and it's safe to immediately write more.
* If send returns false, then more than 64k has been buffered,
* and the caller may wish to wait until the ondrain event
* handler has been called before buffering more data by more
* calls to send.
*
* @throws Throws if the ready state is not OPEN.
*/
[Throws]
boolean send(ByteString data);
/**
* Write data to the socket.
*
* @param data The data to write to the socket.
* @param byteOffset The offset within the data from which to begin writing.
* @param byteLength The number of bytes to write.
* Defaults to the byte length of the ArrayBuffer if not present,
* and clamped to (length - byteOffset).
*
* @return Send returns true or false as a hint to the caller that
* they may either continue sending more data immediately, or
* may want to wait until the other side has read some of the
* data which has already been written to the socket before
* buffering more. If send returns true, then less than 64k
* has been buffered and it's safe to immediately write more.
* If send returns false, then more than 64k has been buffered,
* and the caller may wish to wait until the ondrain event
* handler has been called before buffering more data by more
* calls to send.
*
* @throws Throws if the ready state is not OPEN.
*/
[Throws]
boolean send(ArrayBuffer data, optional unsigned long byteOffset = 0, optional unsigned long byteLength);
/**
* The readyState attribute indicates which state the socket is currently
* in.
*/
readonly attribute TCPReadyState readyState;
/**
* The binaryType attribute indicates which mode this socket uses for
* sending and receiving data. If the binaryType: "arraybuffer" option
* was passed to the open method that created this socket, binaryType
* will be "arraybuffer". Otherwise, it will be "string".
*/
readonly attribute TCPSocketBinaryType binaryType;
/**
* The "open" event is dispatched when the connection to the server
* has been established. If the connection is refused, the "error" event
* will be dispatched, instead.
*/
attribute EventHandler onopen;
/**
* After send has buffered more than 64k of data, it returns false to
* indicate that the client should pause before sending more data, to
* avoid accumulating large buffers. This is only advisory, and the client
* is free to ignore it and buffer as much data as desired, but if reducing
* the size of buffers is important (especially for a streaming application)
* the "drain" event will be dispatched once the previously-buffered data has
* been written to the network, at which point the client can resume calling
* send again.
*/
attribute EventHandler ondrain;
/**
* The "data" event will be dispatched repeatedly and asynchronously after
* "open" is dispatched, every time some data was available from the server
* and was read. The event object will be a TCPSocketEvent; if the "arraybuffer"
* binaryType was passed to the constructor, the data attribute of the event
* object will be an ArrayBuffer. If not, it will be a normal JavaScript string,
* truncated at the first null byte found in the payload and the remainder
* interpreted as ASCII bytes.
*
* At any time, the client may choose to pause reading and receiving "data"
* events by calling the socket's suspend() method. Further "data" events
* will be paused until resume() is called.
*/
attribute EventHandler ondata;
/**
* The "error" event will be dispatched when there is an error. The event
* object will be a TCPSocketErrorEvent.
*
* If an "error" event is dispatched before an "open" one, the connection
* was refused, and the "close" event will not be dispatched. If an "error"
* event is dispatched after an "open" event, the connection was lost,
* and a "close" event will be dispatched subsequently.
*/
attribute EventHandler onerror;
/**
* The "close" event is dispatched once the underlying network socket
* has been closed, either by the server, or by the client calling
* close.
*
* If the "error" event was not dispatched before "close", then one of
* the sides cleanly closed the connection.
*/
attribute EventHandler onclose;
};