1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/socket/nsISocketProvider.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,102 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIProxyInfo; 1.12 +[ptr] native PRFileDescStar(struct PRFileDesc); 1.13 + 1.14 +/** 1.15 + * nsISocketProvider 1.16 + */ 1.17 +[scriptable, uuid(508d5469-9e1e-4a08-b5b0-7cfebba1e51a)] 1.18 +interface nsISocketProvider : nsISupports 1.19 +{ 1.20 + /** 1.21 + * newSocket 1.22 + * 1.23 + * @param aFamily 1.24 + * The address family for this socket (PR_AF_INET or PR_AF_INET6). 1.25 + * @param aHost 1.26 + * The hostname for this connection. 1.27 + * @param aPort 1.28 + * The port for this connection. 1.29 + * @param aProxyHost 1.30 + * If non-null, the proxy hostname for this connection. 1.31 + * @param aProxyPort 1.32 + * The proxy port for this connection. 1.33 + * @param aFlags 1.34 + * Control flags that govern this connection (see below.) 1.35 + * @param aFileDesc 1.36 + * The resulting PRFileDesc. 1.37 + * @param aSecurityInfo 1.38 + * Any security info that should be associated with aFileDesc. This 1.39 + * object typically implements nsITransportSecurityInfo. 1.40 + */ 1.41 + [noscript] 1.42 + void newSocket(in long aFamily, 1.43 + in string aHost, 1.44 + in long aPort, 1.45 + in nsIProxyInfo aProxy, 1.46 + in unsigned long aFlags, 1.47 + out PRFileDescStar aFileDesc, 1.48 + out nsISupports aSecurityInfo); 1.49 + 1.50 + /** 1.51 + * addToSocket 1.52 + * 1.53 + * This function is called to allow the socket provider to layer a 1.54 + * PRFileDesc on top of another PRFileDesc. For example, SSL via a SOCKS 1.55 + * proxy. 1.56 + * 1.57 + * Parameters are the same as newSocket with the exception of aFileDesc, 1.58 + * which is an in-param instead. 1.59 + */ 1.60 + [noscript] 1.61 + void addToSocket(in long aFamily, 1.62 + in string aHost, 1.63 + in long aPort, 1.64 + in nsIProxyInfo aProxy, 1.65 + in unsigned long aFlags, 1.66 + in PRFileDescStar aFileDesc, 1.67 + out nsISupports aSecurityInfo); 1.68 + 1.69 + /** 1.70 + * PROXY_RESOLVES_HOST 1.71 + * 1.72 + * This flag is set if the proxy is to perform hostname resolution instead 1.73 + * of the client. When set, the hostname parameter passed when in this 1.74 + * interface will be used instead of the address structure passed for a 1.75 + * later connect et al. request. 1.76 + */ 1.77 + const long PROXY_RESOLVES_HOST = 1 << 0; 1.78 + 1.79 + /** 1.80 + * When setting this flag, the socket will not apply any 1.81 + * credentials when establishing a connection. For example, 1.82 + * an SSL connection would not send any client-certificates 1.83 + * if this flag is set. 1.84 + */ 1.85 + const long ANONYMOUS_CONNECT = 1 << 1; 1.86 + 1.87 + /** 1.88 + * If set, indicates that the connection was initiated from a source 1.89 + * defined as being private in the sense of Private Browsing. Generally, 1.90 + * there should be no state shared between connections that are private 1.91 + * and those that are not; it is OK for multiple private connections 1.92 + * to share state with each other, and it is OK for multiple non-private 1.93 + * connections to share state with each other. 1.94 + */ 1.95 + const unsigned long NO_PERMANENT_STORAGE = 1 << 2; 1.96 +}; 1.97 + 1.98 +%{C++ 1.99 +/** 1.100 + * nsISocketProvider implementations should be registered with XPCOM under a 1.101 + * contract ID of the form: "@mozilla.org/network/socket;2?type=foo" 1.102 + */ 1.103 +#define NS_NETWORK_SOCKET_CONTRACTID_PREFIX \ 1.104 + "@mozilla.org/network/socket;2?type=" 1.105 +%}