/work/obj-fuzz/dist/include/nsIProtocolHandler.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * DO NOT EDIT. THIS FILE IS GENERATED FROM /src/mozilla-central/netwerk/base/nsIProtocolHandler.idl |
3 | | */ |
4 | | |
5 | | #ifndef __gen_nsIProtocolHandler_h__ |
6 | | #define __gen_nsIProtocolHandler_h__ |
7 | | |
8 | | |
9 | | #ifndef __gen_nsISupports_h__ |
10 | | #include "nsISupports.h" |
11 | | #endif |
12 | | |
13 | | #include "js/GCAnnotations.h" |
14 | | |
15 | | /* For IDL files that don't want to include root IDL files. */ |
16 | | #ifndef NS_NO_VTABLE |
17 | | #define NS_NO_VTABLE |
18 | | #endif |
19 | | #include "nsCOMPtr.h" |
20 | | /** |
21 | | * Protocol handlers are registered with XPCOM under the following CONTRACTID prefix: |
22 | | */ |
23 | 2.50M | #define NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "@mozilla.org/network/protocol;1?name=" |
24 | | /** |
25 | | * For example, "@mozilla.org/network/protocol;1?name=http" |
26 | | */ |
27 | | #if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE) |
28 | | #define IS_ORIGIN_IS_FULL_SPEC_DEFINED 1 |
29 | | #endif |
30 | | class nsIURI; /* forward declaration */ |
31 | | |
32 | | class nsIChannel; /* forward declaration */ |
33 | | |
34 | | class nsILoadInfo; /* forward declaration */ |
35 | | |
36 | | |
37 | | /* starting interface: nsIProtocolHandlerWithDynamicFlags */ |
38 | | #define NS_IPROTOCOLHANDLERWITHDYNAMICFLAGS_IID_STR "65a8e823-0591-4fc0-a56a-03265e0a4ce8" |
39 | | |
40 | | #define NS_IPROTOCOLHANDLERWITHDYNAMICFLAGS_IID \ |
41 | | {0x65a8e823, 0x0591, 0x4fc0, \ |
42 | | { 0xa5, 0x6a, 0x03, 0x26, 0x5e, 0x0a, 0x4c, 0xe8 }} |
43 | | |
44 | | class NS_NO_VTABLE nsIProtocolHandlerWithDynamicFlags : public nsISupports { |
45 | | public: |
46 | | |
47 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPROTOCOLHANDLERWITHDYNAMICFLAGS_IID) |
48 | | |
49 | | /* unsigned long getFlagsForURI (in nsIURI aURI); */ |
50 | | NS_IMETHOD GetFlagsForURI(nsIURI *aURI, uint32_t *_retval) = 0; |
51 | | |
52 | | }; |
53 | | |
54 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIProtocolHandlerWithDynamicFlags, NS_IPROTOCOLHANDLERWITHDYNAMICFLAGS_IID) |
55 | | |
56 | | /* Use this macro when declaring classes that implement this interface. */ |
57 | | #define NS_DECL_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS \ |
58 | | NS_IMETHOD GetFlagsForURI(nsIURI *aURI, uint32_t *_retval) override; |
59 | | |
60 | | /* Use this macro when declaring the members of this interface when the |
61 | | class doesn't implement the interface. This is useful for forwarding. */ |
62 | | #define NS_DECL_NON_VIRTUAL_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS \ |
63 | | nsresult GetFlagsForURI(nsIURI *aURI, uint32_t *_retval); |
64 | | |
65 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
66 | | #define NS_FORWARD_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS(_to) \ |
67 | | NS_IMETHOD GetFlagsForURI(nsIURI *aURI, uint32_t *_retval) override { return _to GetFlagsForURI(aURI, _retval); } |
68 | | |
69 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
70 | | #define NS_FORWARD_SAFE_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS(_to) \ |
71 | | NS_IMETHOD GetFlagsForURI(nsIURI *aURI, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFlagsForURI(aURI, _retval); } |
72 | | |
73 | | |
74 | | /* starting interface: nsIProtocolHandler */ |
75 | | #define NS_IPROTOCOLHANDLER_IID_STR "a87210e6-7c8c-41f7-864d-df809015193e" |
76 | | |
77 | | #define NS_IPROTOCOLHANDLER_IID \ |
78 | | {0xa87210e6, 0x7c8c, 0x41f7, \ |
79 | | { 0x86, 0x4d, 0xdf, 0x80, 0x90, 0x15, 0x19, 0x3e }} |
80 | | |
81 | | class nsIProtocolHandler : public nsISupports { |
82 | | public: |
83 | | |
84 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPROTOCOLHANDLER_IID) |
85 | | |
86 | | /* readonly attribute ACString scheme; */ |
87 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetScheme(nsACString& aScheme) = 0; |
88 | | |
89 | | /* readonly attribute long defaultPort; */ |
90 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) = 0; |
91 | | |
92 | | /* readonly attribute unsigned long protocolFlags; */ |
93 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) = 0; |
94 | | |
95 | | // Helper method to get the protocol flags in the right way. |
96 | | nsresult DoGetProtocolFlags(nsIURI* aURI, uint32_t* aFlags) |
97 | 11.7k | { |
98 | 11.7k | nsCOMPtr<nsIProtocolHandlerWithDynamicFlags> dh = do_QueryInterface(this); |
99 | 11.7k | nsresult rv = dh ? dh->GetFlagsForURI(aURI, aFlags) : GetProtocolFlags(aFlags); |
100 | 11.7k | if (NS_SUCCEEDED(rv)) { |
101 | 11.7k | #if !IS_ORIGIN_IS_FULL_SPEC_DEFINED |
102 | 11.7k | MOZ_RELEASE_ASSERT(!(*aFlags & nsIProtocolHandler::ORIGIN_IS_FULL_SPEC), |
103 | 11.7k | "ORIGIN_IS_FULL_SPEC is unsupported but used"); |
104 | 11.7k | #endif |
105 | 11.7k | } |
106 | 11.7k | return rv; |
107 | 11.7k | } |
108 | | /* nsIURI newURI (in AUTF8String aSpec, [optional] in string aOriginCharset, [optional] in nsIURI aBaseURI); */ |
109 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD NewURI(const nsACString& aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) = 0; |
110 | | |
111 | | /* nsIChannel newChannel2 (in nsIURI aURI, in nsILoadInfo aLoadinfo); */ |
112 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel **_retval) = 0; |
113 | | |
114 | | /* nsIChannel newChannel (in nsIURI aURI); */ |
115 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel **_retval) = 0; |
116 | | |
117 | | /* boolean allowPort (in long port, in string scheme); */ |
118 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) = 0; |
119 | | |
120 | | enum { |
121 | | URI_STD = 0U, |
122 | | URI_NORELATIVE = 1U, |
123 | | URI_NOAUTH = 2U, |
124 | | ALLOWS_PROXY = 4U, |
125 | | ALLOWS_PROXY_HTTP = 8U, |
126 | | URI_INHERITS_SECURITY_CONTEXT = 16U, |
127 | | URI_FORBIDS_AUTOMATIC_DOCUMENT_REPLACEMENT = 32U, |
128 | | URI_LOADABLE_BY_ANYONE = 64U, |
129 | | URI_DANGEROUS_TO_LOAD = 128U, |
130 | | URI_IS_UI_RESOURCE = 256U, |
131 | | URI_IS_LOCAL_FILE = 512U, |
132 | | URI_LOADABLE_BY_SUBSUMERS = 1024U, |
133 | | URI_DOES_NOT_RETURN_DATA = 2048U, |
134 | | URI_IS_LOCAL_RESOURCE = 4096U, |
135 | | URI_OPENING_EXECUTES_SCRIPT = 8192U, |
136 | | URI_NON_PERSISTABLE = 16384U, |
137 | | URI_FORBIDS_COOKIE_ACCESS = 32768U, |
138 | | URI_CROSS_ORIGIN_NEEDS_WEBAPPS_PERM = 65536U, |
139 | | URI_SYNC_LOAD_IS_OK = 131072U, |
140 | | URI_IS_POTENTIALLY_TRUSTWORTHY = 262144U, |
141 | | URI_FETCHABLE_BY_ANYONE = 524288U, |
142 | | ORIGIN_IS_FULL_SPEC = 1048576U, |
143 | | URI_SCHEME_NOT_SELF_LINKABLE = 2097152U, |
144 | | URI_LOADABLE_BY_EXTENSIONS = 4194304U |
145 | | }; |
146 | | |
147 | | }; |
148 | | |
149 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIProtocolHandler, NS_IPROTOCOLHANDLER_IID) |
150 | | |
151 | | /* Use this macro when declaring classes that implement this interface. */ |
152 | | #define NS_DECL_NSIPROTOCOLHANDLER \ |
153 | | NS_IMETHOD GetScheme(nsACString& aScheme) override; \ |
154 | | NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) override; \ |
155 | | NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) override; \ |
156 | | NS_IMETHOD NewURI(const nsACString& aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) override; \ |
157 | | NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel **_retval) override; \ |
158 | | NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel **_retval) override; \ |
159 | | NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) override; \ |
160 | | |
161 | | /* Use this macro when declaring the members of this interface when the |
162 | | class doesn't implement the interface. This is useful for forwarding. */ |
163 | | #define NS_DECL_NON_VIRTUAL_NSIPROTOCOLHANDLER \ |
164 | | nsresult GetScheme(nsACString& aScheme); \ |
165 | | nsresult GetDefaultPort(int32_t *aDefaultPort); \ |
166 | | nsresult GetProtocolFlags(uint32_t *aProtocolFlags); \ |
167 | | nsresult NewURI(const nsACString& aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval); \ |
168 | | nsresult NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel **_retval); \ |
169 | | nsresult NewChannel(nsIURI *aURI, nsIChannel **_retval); \ |
170 | | nsresult AllowPort(int32_t port, const char * scheme, bool *_retval); \ |
171 | | |
172 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
173 | | #define NS_FORWARD_NSIPROTOCOLHANDLER(_to) \ |
174 | 0 | NS_IMETHOD GetScheme(nsACString& aScheme) override { return _to GetScheme(aScheme); } \ Unexecuted instantiation: nsResProtocolHandler::GetScheme(nsTSubstring<char>&) Unexecuted instantiation: mozilla::net::ExtensionProtocolHandler::GetScheme(nsTSubstring<char>&) |
175 | 0 | NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) override { return _to GetDefaultPort(aDefaultPort); } \ Unexecuted instantiation: nsResProtocolHandler::GetDefaultPort(int*) Unexecuted instantiation: mozilla::net::ExtensionProtocolHandler::GetDefaultPort(int*) |
176 | 19 | NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) override { return _to GetProtocolFlags(aProtocolFlags); } \ nsResProtocolHandler::GetProtocolFlags(unsigned int*) Line | Count | Source | 176 | 19 | NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) override { return _to GetProtocolFlags(aProtocolFlags); } \ |
Unexecuted instantiation: mozilla::net::ExtensionProtocolHandler::GetProtocolFlags(unsigned int*) |
177 | 2.57k | NS_IMETHOD NewURI(const nsACString& aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) override { return _to NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \ nsResProtocolHandler::NewURI(nsTSubstring<char> const&, char const*, nsIURI*, nsIURI**) Line | Count | Source | 177 | 2.57k | NS_IMETHOD NewURI(const nsACString& aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) override { return _to NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \ |
Unexecuted instantiation: mozilla::net::ExtensionProtocolHandler::NewURI(nsTSubstring<char> const&, char const*, nsIURI*, nsIURI**) |
178 | 4 | NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel **_retval) override { return _to NewChannel2(aURI, aLoadinfo, _retval); } \ nsResProtocolHandler::NewChannel2(nsIURI*, nsILoadInfo*, nsIChannel**) Line | Count | Source | 178 | 4 | NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel **_retval) override { return _to NewChannel2(aURI, aLoadinfo, _retval); } \ |
Unexecuted instantiation: mozilla::net::ExtensionProtocolHandler::NewChannel2(nsIURI*, nsILoadInfo*, nsIChannel**) |
179 | 0 | NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel **_retval) override { return _to NewChannel(aURI, _retval); } \ Unexecuted instantiation: nsResProtocolHandler::NewChannel(nsIURI*, nsIChannel**) Unexecuted instantiation: mozilla::net::ExtensionProtocolHandler::NewChannel(nsIURI*, nsIChannel**) |
180 | 0 | NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) override { return _to AllowPort(port, scheme, _retval); } \ Unexecuted instantiation: nsResProtocolHandler::AllowPort(int, char const*, bool*) Unexecuted instantiation: mozilla::net::ExtensionProtocolHandler::AllowPort(int, char const*, bool*) |
181 | | |
182 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
183 | | #define NS_FORWARD_SAFE_NSIPROTOCOLHANDLER(_to) \ |
184 | | NS_IMETHOD GetScheme(nsACString& aScheme) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetScheme(aScheme); } \ |
185 | | NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultPort(aDefaultPort); } \ |
186 | | NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProtocolFlags(aProtocolFlags); } \ |
187 | | NS_IMETHOD NewURI(const nsACString& aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \ |
188 | | NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel2(aURI, aLoadinfo, _retval); } \ |
189 | | NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel(aURI, _retval); } \ |
190 | | NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AllowPort(port, scheme, _retval); } \ |
191 | | |
192 | | |
193 | | #endif /* __gen_nsIProtocolHandler_h__ */ |