2015-09-24 11:16:47 +03:00
|
|
|
/* 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 "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIPresentationChannelDescription;
|
|
|
|
interface nsISocketTransport;
|
2016-04-11 06:20:55 +03:00
|
|
|
interface mozIDOMWindow;
|
2015-09-24 11:16:47 +03:00
|
|
|
interface nsIPresentationControlChannel;
|
|
|
|
interface nsIPresentationSessionTransport;
|
|
|
|
|
|
|
|
[scriptable, uuid(673f6de1-e253-41b8-9be8-b7ff161fa8dc)]
|
|
|
|
interface nsIPresentationSessionTransportBuilderListener : nsISupports
|
|
|
|
{
|
|
|
|
// Should set |transport.callback| in |onSessionTransport|.
|
|
|
|
void onSessionTransport(in nsIPresentationSessionTransport transport);
|
|
|
|
void onError(in nsresult reason);
|
2016-06-03 06:03:15 +03:00
|
|
|
|
|
|
|
void sendOffer(in nsIPresentationChannelDescription offer);
|
|
|
|
void sendAnswer(in nsIPresentationChannelDescription answer);
|
2018-09-06 11:02:43 +03:00
|
|
|
void sendIceCandidate(in AString candidate);
|
2016-06-03 06:03:15 +03:00
|
|
|
void close(in nsresult reason);
|
2015-09-24 11:16:47 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
[scriptable, uuid(2fdbe67d-80f9-48dc-8237-5bef8fa19801)]
|
|
|
|
interface nsIPresentationSessionTransportBuilder : nsISupports
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
2016-09-16 15:59:00 +03:00
|
|
|
/**
|
|
|
|
* The constructor for creating a transport builder.
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(706482b2-1b51-4bed-a21d-785a9cfcfac7)]
|
|
|
|
interface nsIPresentationTransportBuilderConstructor : nsISupports
|
|
|
|
{
|
|
|
|
nsIPresentationSessionTransportBuilder createTransportBuilder(in uint8_t type);
|
|
|
|
};
|
|
|
|
|
2015-09-24 11:16:47 +03:00
|
|
|
/**
|
|
|
|
* Builder for TCP session transport
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(cde36d6e-f471-4262-a70d-f932a26b21d9)]
|
|
|
|
interface nsIPresentationTCPSessionTransportBuilder : nsIPresentationSessionTransportBuilder
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The following creation functions will trigger |listener.onSessionTransport|
|
|
|
|
* if the session transport is successfully built, |listener.onError| if some
|
|
|
|
* error occurs during building session transport.
|
|
|
|
*/
|
|
|
|
void buildTCPSenderTransport(in nsISocketTransport aTransport,
|
|
|
|
in nsIPresentationSessionTransportBuilderListener aListener);
|
|
|
|
|
|
|
|
void buildTCPReceiverTransport(in nsIPresentationChannelDescription aDescription,
|
|
|
|
in nsIPresentationSessionTransportBuilderListener aListener);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Builder for WebRTC data channel session transport
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(8131c4e0-3a8c-4bc1-a92a-8431473d2fe8)]
|
|
|
|
interface nsIPresentationDataChannelSessionTransportBuilder : nsIPresentationSessionTransportBuilder
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The following creation function will trigger |listener.onSessionTransport|
|
|
|
|
* if the session transport is successfully built, |listener.onError| if some
|
2016-07-12 05:16:46 +03:00
|
|
|
* error occurs during creating session transport. The |notifyConnected| of
|
2016-04-11 06:20:55 +03:00
|
|
|
* |aControlChannel| should be called before calling
|
|
|
|
* |buildDataChannelTransport|.
|
2015-09-24 11:16:47 +03:00
|
|
|
*/
|
2016-06-03 06:03:15 +03:00
|
|
|
void buildDataChannelTransport(in uint8_t aRole,
|
2016-04-11 06:20:55 +03:00
|
|
|
in mozIDOMWindow aWindow,
|
2015-09-24 11:16:47 +03:00
|
|
|
in nsIPresentationSessionTransportBuilderListener aListener);
|
2016-06-03 06:03:15 +03:00
|
|
|
|
|
|
|
// Bug 1275150 - Merge TCP builder with the following APIs
|
|
|
|
void onOffer(in nsIPresentationChannelDescription offer);
|
|
|
|
void onAnswer(in nsIPresentationChannelDescription answer);
|
2018-09-06 11:02:43 +03:00
|
|
|
void onIceCandidate(in AString candidate);
|
2016-07-12 05:16:46 +03:00
|
|
|
void notifyDisconnected(in nsresult reason);
|
2015-09-24 11:16:47 +03:00
|
|
|
};
|