зеркало из https://github.com/mozilla/gecko-dev.git
Bug 885982 - Add missing IDL on a CLOSED TREE.
This commit is contained in:
Родитель
2e2e3a6cef
Коммит
6334294144
|
@ -0,0 +1,133 @@
|
|||
/* 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"
|
||||
|
||||
interface nsISocketTransport;
|
||||
interface nsITCPSocketChild;
|
||||
|
||||
/*
|
||||
* This interface is implemented in TCPSocket.js as an internal interfaces
|
||||
* 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(E79C5F3C-0B54-44B9-B0D7-6930EF9126DC)]
|
||||
interface nsITCPSocketInternal : nsISupports {
|
||||
/**
|
||||
* Enable secure on channel.
|
||||
*/
|
||||
void upgradeToSecure();
|
||||
|
||||
/**
|
||||
* The host of this socket object.
|
||||
*/
|
||||
readonly attribute DOMString host;
|
||||
|
||||
/**
|
||||
* The port of this socket object.
|
||||
*/
|
||||
readonly attribute unsigned short port;
|
||||
|
||||
/**
|
||||
* Pause reading incoming data and invocations of the ondata handler until
|
||||
* resume is called.
|
||||
*/
|
||||
void suspend();
|
||||
|
||||
/**
|
||||
* Resume reading incoming data and invoking ondata as usual.
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Close the socket.
|
||||
*/
|
||||
void close();
|
||||
|
||||
// Trigger the callback for |type| and provide a DOMError() object with the given data
|
||||
void callListenerError(in DOMString type, in DOMString name);
|
||||
|
||||
// Trigger the callback for |type| and provide a string argument
|
||||
void callListenerData(in DOMString type, in DOMString data);
|
||||
|
||||
// Trigger the callback for |type| and provide an ArrayBuffer argument
|
||||
void callListenerArrayBuffer(in DOMString type, in jsval data);
|
||||
|
||||
// Trigger the callback for |type| with no argument
|
||||
void callListenerVoid(in DOMString type);
|
||||
|
||||
// Update the DOM object's readyState.
|
||||
// @param readyState
|
||||
// new ready state to be set to TCPSocket.
|
||||
void updateReadyState(in DOMString readyState);
|
||||
|
||||
// Update the DOM object's bufferedAmount value with a tracking number to
|
||||
// ensure the update request is sent after child's send() invocation.
|
||||
// @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);
|
||||
|
||||
// Initialize a socket object on the parent side.
|
||||
// This is called in accepting any open request on the parent side.
|
||||
//
|
||||
// @param transport
|
||||
// The accepted socket transport.
|
||||
// @param binaryType
|
||||
// "arraybuffer" to use ArrayBuffer instances
|
||||
// in the ondata callback and as the argument to send.
|
||||
// @param global
|
||||
// An object to create ArrayBuffer for this global. See Bug 831107.
|
||||
void initAcceptedParent(in nsISocketTransport transport,
|
||||
in DOMString binaryType,
|
||||
in nsISupports global);
|
||||
|
||||
// Initialize a DOM socket on the child side
|
||||
// This is called when the socket is accepted on the parent side.
|
||||
//
|
||||
// @param socketChild
|
||||
// The socket child object for the IPC implementation.
|
||||
// @param binaryType
|
||||
// "arraybuffer" to use ArrayBuffer instances
|
||||
// in the ondata callback and as the argument to send.
|
||||
// @param global
|
||||
// An object to create ArrayBuffer for this global. See Bug 831107.
|
||||
void initAcceptedChild(in nsITCPSocketChild socketChild,
|
||||
in DOMString binaryType,
|
||||
in nsISupports global);
|
||||
|
||||
// Set App ID.
|
||||
void setAppId(in unsigned long appId);
|
||||
|
||||
// Set inBrowser.
|
||||
void setInBrowser(in boolean inBrowser);
|
||||
|
||||
// Set a callback that handles the request from a TCP socket parent when that
|
||||
// socket parent wants to notify that its bufferedAmount is updated.
|
||||
void setOnUpdateBufferedAmountHandler(in jsval handler);
|
||||
|
||||
// Providing child process with ability to pass more arguments to parent's
|
||||
// send() function.
|
||||
// @param trackingNumber
|
||||
// To ensure the request to update bufferedAmount in child is after
|
||||
// lastest send() invocation from child.
|
||||
void onRecvSendFromChild(in jsval data, in unsigned long byteOffset,
|
||||
in unsigned long byteLength, in unsigned long trackingNumber);
|
||||
|
||||
/**
|
||||
* Called by the parent process when there is no DOM window available.
|
||||
*/
|
||||
void initWithGlobal(in nsISupports global);
|
||||
};
|
Загрузка…
Ссылка в новой задаче