dom/network/interfaces/nsIUDPSocketChild.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/network/interfaces/nsIUDPSocketChild.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "nsISupports.idl"
     1.9 +#include "nsINetAddr.idl"
    1.10 +
    1.11 +interface nsIUDPSocketInternal;
    1.12 +
    1.13 +%{ C++
    1.14 +namespace mozilla {
    1.15 +namespace net {
    1.16 +union NetAddr;
    1.17 +}
    1.18 +}
    1.19 +%}
    1.20 +native NetAddr(mozilla::net::NetAddr);
    1.21 +[ptr] native NetAddrPtr(mozilla::net::NetAddr);
    1.22 +
    1.23 +[scriptable, uuid(B47E5A0F-D384-48EF-8885-4259793D9CF0)]
    1.24 +interface nsIUDPSocketChild : nsISupports
    1.25 +{
    1.26 +  readonly attribute unsigned short localPort;
    1.27 +  readonly attribute AUTF8String localAddress;
    1.28 +  attribute AUTF8String filterName;
    1.29 +
    1.30 +  // Tell the chrome process to bind the UDP socket to a given local host and port
    1.31 +  void bind(in nsIUDPSocketInternal socket, in AUTF8String host, in unsigned short port);
    1.32 +
    1.33 +  // Tell the chrome process to perform equivalent operations to all following methods
    1.34 +  void send(in AUTF8String host, in unsigned short port,
    1.35 +            [const, array, size_is(byteLength)] in uint8_t bytes,
    1.36 +            in unsigned long byteLength);
    1.37 +  // Send without DNS query
    1.38 +  void sendWithAddr(in nsINetAddr addr,
    1.39 +                    [const, array, size_is(byteLength)] in uint8_t bytes,
    1.40 +                    in unsigned long byteLength);
    1.41 +  [noscript] void sendWithAddress([const] in NetAddrPtr addr,
    1.42 +                                  [const, array, size_is(byteLength)] in uint8_t bytes,
    1.43 +                                  in unsigned long byteLength);
    1.44 +  void close();
    1.45 +};
    1.46 +
    1.47 +/*
    1.48 + * Internal interface for callback from chrome process
    1.49 + */
    1.50 +[scriptable, uuid(1E27E9B3-C1C8-4B05-A415-1A2C1A641C60)]
    1.51 +interface nsIUDPSocketInternal : nsISupports
    1.52 +{
    1.53 +  void callListenerError(in AUTF8String type, in AUTF8String message, in AUTF8String filename,
    1.54 +                         in uint32_t lineNumber, in uint32_t columnNumber);
    1.55 +  void callListenerReceivedData(in AUTF8String type, in AUTF8String host, in unsigned short port,
    1.56 +                                [array, size_is(dataLength)] in uint8_t data,
    1.57 +                                in unsigned long dataLength);
    1.58 +  void callListenerVoid(in AUTF8String type);
    1.59 +  void callListenerSent(in AUTF8String type, in nsresult status);
    1.60 +  void updateReadyState(in AUTF8String readyState);
    1.61 +};

mercurial