Bug 1760181 [wpt PR 33182] - Update wpt metadata, a=testonly
[gecko.git] / netwerk / socket / nsISocketProvider.idl
blobaf6709570ef02671d122642ba074fec81c207910
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsIProxyInfo;
9 [ptr] native PRFileDescStar(struct PRFileDesc);
10 native OriginAttributes(mozilla::OriginAttributes);
11 [ref] native const_OriginAttributesRef(const mozilla::OriginAttributes);
13 %{ C++
14 #include "mozilla/BasePrincipal.h"
17 /**
18 * nsISocketProvider
20 [scriptable, uuid(508d5469-9e1e-4a08-b5b0-7cfebba1e51a)]
21 interface nsISocketProvider : nsISupports
23 /**
24 * newSocket
26 * @param aFamily
27 * The address family for this socket (PR_AF_INET or PR_AF_INET6).
28 * @param aHost
29 * The origin hostname for this connection.
30 * @param aPort
31 * The origin port for this connection.
32 * @param aProxyHost
33 * If non-null, the proxy hostname for this connection.
34 * @param aProxyPort
35 * The proxy port for this connection.
36 * @param aFlags
37 * Control flags that govern this connection (see below.)
38 * @param aTlsFlags
39 * An opaque flags for non-standard behavior of the TLS system.
40 * It is unlikely this will need to be set outside of telemetry
41 * studies relating to the TLS implementation.
42 * @param aFileDesc
43 * The resulting PRFileDesc.
44 * @param aSecurityInfo
45 * Any security info that should be associated with aFileDesc. This
46 * object typically implements nsITransportSecurityInfo.
48 [noscript]
49 void newSocket(in long aFamily,
50 in string aHost,
51 in long aPort,
52 in nsIProxyInfo aProxy,
53 in const_OriginAttributesRef aOriginAttributes,
54 in unsigned long aFlags,
55 in unsigned long aTlsFlags,
56 out PRFileDescStar aFileDesc,
57 out nsISupports aSecurityInfo);
59 /**
60 * addToSocket
62 * This function is called to allow the socket provider to layer a
63 * PRFileDesc on top of another PRFileDesc. For example, SSL via a SOCKS
64 * proxy.
66 * Parameters are the same as newSocket with the exception of aFileDesc,
67 * which is an in-param instead.
69 [noscript]
70 void addToSocket(in long aFamily,
71 in string aHost,
72 in long aPort,
73 in nsIProxyInfo aProxy,
74 in const_OriginAttributesRef aOriginAttributes,
75 in unsigned long aFlags,
76 in unsigned long aTlsFlags,
77 in PRFileDescStar aFileDesc,
78 out nsISupports aSecurityInfo);
80 /**
81 * PROXY_RESOLVES_HOST
83 * This flag is set if the proxy is to perform hostname resolution instead
84 * of the client. When set, the hostname parameter passed when in this
85 * interface will be used instead of the address structure passed for a
86 * later connect et al. request.
88 const long PROXY_RESOLVES_HOST = 1 << 0;
90 /**
91 * When setting this flag, the socket will not apply any
92 * credentials when establishing a connection. For example,
93 * an SSL connection would not send any client-certificates
94 * if this flag is set.
96 const long ANONYMOUS_CONNECT = 1 << 1;
98 /**
99 * If set, indicates that the connection was initiated from a source
100 * defined as being private in the sense of Private Browsing. Generally,
101 * there should be no state shared between connections that are private
102 * and those that are not; it is OK for multiple private connections
103 * to share state with each other, and it is OK for multiple non-private
104 * connections to share state with each other.
106 const unsigned long NO_PERMANENT_STORAGE = 1 << 2;
109 * If set, do not use newer protocol features that might have interop problems
110 * on the Internet. Intended only for use with critical infra like the updater.
111 * default is false.
113 const unsigned long BE_CONSERVATIVE = 1 << 3;
116 * This is used for a temporary workaround for a web-compat issue. The flag is
117 * only set on CORS preflight request to allowed sending client certificates
118 * on a connection for an anonymous request.
120 const long ANONYMOUS_CONNECT_ALLOW_CLIENT_CERT = 1 << 4;