Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "nsISupports.idl" |
michael@0 | 6 | #include "nsINetAddr.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIUDPSocketInternal; |
michael@0 | 9 | |
michael@0 | 10 | %{ C++ |
michael@0 | 11 | namespace mozilla { |
michael@0 | 12 | namespace net { |
michael@0 | 13 | union NetAddr; |
michael@0 | 14 | } |
michael@0 | 15 | } |
michael@0 | 16 | %} |
michael@0 | 17 | native NetAddr(mozilla::net::NetAddr); |
michael@0 | 18 | [ptr] native NetAddrPtr(mozilla::net::NetAddr); |
michael@0 | 19 | |
michael@0 | 20 | [scriptable, uuid(B47E5A0F-D384-48EF-8885-4259793D9CF0)] |
michael@0 | 21 | interface nsIUDPSocketChild : nsISupports |
michael@0 | 22 | { |
michael@0 | 23 | readonly attribute unsigned short localPort; |
michael@0 | 24 | readonly attribute AUTF8String localAddress; |
michael@0 | 25 | attribute AUTF8String filterName; |
michael@0 | 26 | |
michael@0 | 27 | // Tell the chrome process to bind the UDP socket to a given local host and port |
michael@0 | 28 | void bind(in nsIUDPSocketInternal socket, in AUTF8String host, in unsigned short port); |
michael@0 | 29 | |
michael@0 | 30 | // Tell the chrome process to perform equivalent operations to all following methods |
michael@0 | 31 | void send(in AUTF8String host, in unsigned short port, |
michael@0 | 32 | [const, array, size_is(byteLength)] in uint8_t bytes, |
michael@0 | 33 | in unsigned long byteLength); |
michael@0 | 34 | // Send without DNS query |
michael@0 | 35 | void sendWithAddr(in nsINetAddr addr, |
michael@0 | 36 | [const, array, size_is(byteLength)] in uint8_t bytes, |
michael@0 | 37 | in unsigned long byteLength); |
michael@0 | 38 | [noscript] void sendWithAddress([const] in NetAddrPtr addr, |
michael@0 | 39 | [const, array, size_is(byteLength)] in uint8_t bytes, |
michael@0 | 40 | in unsigned long byteLength); |
michael@0 | 41 | void close(); |
michael@0 | 42 | }; |
michael@0 | 43 | |
michael@0 | 44 | /* |
michael@0 | 45 | * Internal interface for callback from chrome process |
michael@0 | 46 | */ |
michael@0 | 47 | [scriptable, uuid(1E27E9B3-C1C8-4B05-A415-1A2C1A641C60)] |
michael@0 | 48 | interface nsIUDPSocketInternal : nsISupports |
michael@0 | 49 | { |
michael@0 | 50 | void callListenerError(in AUTF8String type, in AUTF8String message, in AUTF8String filename, |
michael@0 | 51 | in uint32_t lineNumber, in uint32_t columnNumber); |
michael@0 | 52 | void callListenerReceivedData(in AUTF8String type, in AUTF8String host, in unsigned short port, |
michael@0 | 53 | [array, size_is(dataLength)] in uint8_t data, |
michael@0 | 54 | in unsigned long dataLength); |
michael@0 | 55 | void callListenerVoid(in AUTF8String type); |
michael@0 | 56 | void callListenerSent(in AUTF8String type, in nsresult status); |
michael@0 | 57 | void updateReadyState(in AUTF8String readyState); |
michael@0 | 58 | }; |