DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (777e60ca8853)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
/* 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"
#include "nsINetAddr.idl"

interface nsIUDPSocketInternal;

%{ C++
namespace mozilla {
namespace net {
union NetAddr;
}
}
%}
native NetAddr(mozilla::net::NetAddr);
[ptr] native NetAddrPtr(mozilla::net::NetAddr);

[scriptable, uuid(B47E5A0F-D384-48EF-8885-4259793D9CF0)]
interface nsIUDPSocketChild : nsISupports
{
  readonly attribute unsigned short localPort;
  readonly attribute AUTF8String localAddress;
  attribute AUTF8String filterName;

  // Tell the chrome process to bind the UDP socket to a given local host and port
  void bind(in nsIUDPSocketInternal socket, in AUTF8String host, in unsigned short port);

  // Tell the chrome process to perform equivalent operations to all following methods
  void send(in AUTF8String host, in unsigned short port,
            [const, array, size_is(byteLength)] in uint8_t bytes,
            in unsigned long byteLength);
  // Send without DNS query
  void sendWithAddr(in nsINetAddr addr,
                    [const, array, size_is(byteLength)] in uint8_t bytes,
                    in unsigned long byteLength);
  [noscript] void sendWithAddress([const] in NetAddrPtr addr,
                                  [const, array, size_is(byteLength)] in uint8_t bytes,
                                  in unsigned long byteLength);
  void close();
};

/*
 * Internal interface for callback from chrome process
 */
[scriptable, uuid(1E27E9B3-C1C8-4B05-A415-1A2C1A641C60)]
interface nsIUDPSocketInternal : nsISupports
{
  void callListenerError(in AUTF8String type, in AUTF8String message, in AUTF8String filename,
                         in uint32_t lineNumber, in uint32_t columnNumber);
  void callListenerReceivedData(in AUTF8String type, in AUTF8String host, in unsigned short port,
                                [array, size_is(dataLength)] in uint8_t data,
                                in unsigned long dataLength);
  void callListenerVoid(in AUTF8String type);
  void callListenerSent(in AUTF8String type, in nsresult status);
  void updateReadyState(in AUTF8String readyState);
};