summaryrefslogtreecommitdiffstats
path: root/dom/network/interfaces/nsITCPSocketCallback.idl
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/network/interfaces/nsITCPSocketCallback.idl
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/network/interfaces/nsITCPSocketCallback.idl')
-rw-r--r--dom/network/interfaces/nsITCPSocketCallback.idl59
1 files changed, 59 insertions, 0 deletions
diff --git a/dom/network/interfaces/nsITCPSocketCallback.idl b/dom/network/interfaces/nsITCPSocketCallback.idl
new file mode 100644
index 000000000..5ab85dcc7
--- /dev/null
+++ b/dom/network/interfaces/nsITCPSocketCallback.idl
@@ -0,0 +1,59 @@
+/* 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/. */
+
+/**
+ * MozTCPSocket exposes a TCP client and server sockets
+ * to highly privileged apps. It provides a buffered, non-blocking
+ * interface for sending. For receiving, it uses an asynchronous,
+ * event handler based interface.
+ */
+
+#include "domstubs.idl"
+
+%{C++
+#include "nsTArrayForwardDeclare.h"
+%}
+[ref] native nsUint8TArrayRef(InfallibleTArray<uint8_t>);
+[ptr] native JSContextPtr(JSContext);
+
+
+/*
+ * This interface is implemented in TCPSocket.cpp as an internal interface
+ * for use in cross-process socket implementation.
+ * Needed to account for multiple possible types that can be provided to
+ * the socket callbacks as arguments.
+ */
+[scriptable, uuid(ac2c4b69-cb79-4767-b1ce-bcf62945cd39)]
+interface nsITCPSocketCallback : nsISupports {
+ // Limitation of TCPSocket's buffer size.
+ const unsigned long BUFFER_SIZE = 65536;
+
+ // Dispatch an "error" event at this object with the given name and type.
+ void fireErrorEvent(in AString name, in AString type);
+
+ // Dispatch a "data" event at this object with a string
+ void fireDataStringEvent(in DOMString type, in ACString data);
+
+ // Dispatch a "data" event at this object with an Array
+ void fireDataArrayEvent(in DOMString type, [const] in nsUint8TArrayRef data);
+
+ // Dispatch an event of the given type at this object.
+ void fireEvent(in DOMString type);
+
+ // Update the DOM object's readyState.
+ // @param readyState
+ // new ready state
+ void updateReadyState(in unsigned long readystate);
+
+ // Update the DOM object's bufferedAmount value with a tracking number to
+ // to allow tracking of which writes are "in-flight"
+ // @param bufferedAmount
+ // TCPSocket parent's bufferedAmount.
+ // @param trackingNumber
+ // A number to ensure the bufferedAmount is updated after data
+ // from child are sent to parent.
+ void updateBufferedAmount(in uint32_t bufferedAmount,
+ in uint32_t trackingNumber);
+};
+