/work/obj-fuzz/dist/include/nsIURIMutator.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * DO NOT EDIT. THIS FILE IS GENERATED FROM /src/mozilla-central/netwerk/base/nsIURIMutator.idl |
3 | | */ |
4 | | |
5 | | #ifndef __gen_nsIURIMutator_h__ |
6 | | #define __gen_nsIURIMutator_h__ |
7 | | |
8 | | |
9 | | #ifndef __gen_nsISupports_h__ |
10 | | #include "nsISupports.h" |
11 | | #endif |
12 | | |
13 | | /* For IDL files that don't want to include root IDL files. */ |
14 | | #ifndef NS_NO_VTABLE |
15 | | #define NS_NO_VTABLE |
16 | | #endif |
17 | | class nsIURI; /* forward declaration */ |
18 | | |
19 | | class nsIObjectInputStream; /* forward declaration */ |
20 | | |
21 | | class nsIURIMutator; /* forward declaration */ |
22 | | |
23 | | #include "nsString.h" |
24 | | #include "nsCOMPtr.h" |
25 | | #include <functional> |
26 | | #undef SetPort // XXX Windows! |
27 | | namespace mozilla { |
28 | | class Encoding; |
29 | | } |
30 | | namespace mozilla { |
31 | | namespace ipc { |
32 | | class URIParams; |
33 | | } // namespace ipc |
34 | | } // namespace mozilla |
35 | | template <class T> |
36 | | class BaseURIMutator |
37 | | { |
38 | | // This is the base class that can be extended by implementors of nsIURIMutator |
39 | | // in order to avoid code duplication |
40 | | // Class type T should be the type of the class that implements nsIURI |
41 | | protected: |
42 | | virtual T* Create() |
43 | 1.92M | { |
44 | 1.92M | return new T(); |
45 | 1.92M | } Unexecuted instantiation: BaseURIMutator<mozilla::net::nsStandardURL>::Create() Unexecuted instantiation: BaseURIMutator<mozilla::net::SubstitutingURL>::Create() BaseURIMutator<mozilla::net::nsSimpleURI>::Create() Line | Count | Source | 43 | 1.91M | { | 44 | 1.91M | return new T(); | 45 | 1.91M | } |
Unexecuted instantiation: BaseURIMutator<mozilla::net::nsSimpleNestedURI>::Create() Unexecuted instantiation: BaseURIMutator<mozilla::net::nsNestedAboutURI>::Create() Unexecuted instantiation: BaseURIMutator<nsJSURI>::Create() Unexecuted instantiation: BaseURIMutator<mozilla::NullPrincipalURI>::Create() BaseURIMutator<mozilla::dom::BlobURL>::Create() Line | Count | Source | 43 | 1.77k | { | 44 | 1.77k | return new T(); | 45 | 1.77k | } |
Unexecuted instantiation: BaseURIMutator<nsJARURI>::Create() Unexecuted instantiation: BaseURIMutator<nsMozIconURI>::Create() |
46 | | MOZ_MUST_USE nsresult InitFromURI(T* aURI) |
47 | 3.91k | { |
48 | 3.91k | nsCOMPtr<nsIURI> clone; |
49 | 3.91k | nsresult rv = aURI->Clone(getter_AddRefs(clone)); |
50 | 3.91k | if (NS_FAILED(rv)) { |
51 | 0 | return rv; |
52 | 0 | } |
53 | 3.91k | mURI = static_cast<T*>(clone.get()); |
54 | 3.91k | return NS_OK; |
55 | 3.91k | } Unexecuted instantiation: BaseURIMutator<mozilla::net::SubstitutingURL>::InitFromURI(mozilla::net::SubstitutingURL*) Unexecuted instantiation: BaseURIMutator<mozilla::net::nsSimpleNestedURI>::InitFromURI(mozilla::net::nsSimpleNestedURI*) Unexecuted instantiation: BaseURIMutator<mozilla::net::nsSimpleURI>::InitFromURI(mozilla::net::nsSimpleURI*) BaseURIMutator<mozilla::net::nsStandardURL>::InitFromURI(mozilla::net::nsStandardURL*) Line | Count | Source | 47 | 3.91k | { | 48 | 3.91k | nsCOMPtr<nsIURI> clone; | 49 | 3.91k | nsresult rv = aURI->Clone(getter_AddRefs(clone)); | 50 | 3.91k | if (NS_FAILED(rv)) { | 51 | 0 | return rv; | 52 | 0 | } | 53 | 3.91k | mURI = static_cast<T*>(clone.get()); | 54 | 3.91k | return NS_OK; | 55 | 3.91k | } |
Unexecuted instantiation: BaseURIMutator<mozilla::net::nsNestedAboutURI>::InitFromURI(mozilla::net::nsNestedAboutURI*) Unexecuted instantiation: BaseURIMutator<nsJARURI>::InitFromURI(nsJARURI*) Unexecuted instantiation: BaseURIMutator<mozilla::NullPrincipalURI>::InitFromURI(mozilla::NullPrincipalURI*) Unexecuted instantiation: BaseURIMutator<nsMozIconURI>::InitFromURI(nsMozIconURI*) Unexecuted instantiation: BaseURIMutator<mozilla::dom::BlobURL>::InitFromURI(mozilla::dom::BlobURL*) Unexecuted instantiation: BaseURIMutator<nsJSURI>::InitFromURI(nsJSURI*) |
56 | | MOZ_MUST_USE nsresult InitFromInputStream(nsIObjectInputStream* aStream) |
57 | 0 | { |
58 | 0 | RefPtr<T> uri = Create(); |
59 | 0 | nsresult rv = uri->ReadPrivate(aStream); |
60 | 0 | if (NS_FAILED(rv)) { |
61 | 0 | return rv; |
62 | 0 | } |
63 | 0 | mURI = uri.forget(); |
64 | 0 | return NS_OK; |
65 | 0 | } Unexecuted instantiation: BaseURIMutator<mozilla::net::nsStandardURL>::InitFromInputStream(nsIObjectInputStream*) Unexecuted instantiation: BaseURIMutator<mozilla::net::SubstitutingURL>::InitFromInputStream(nsIObjectInputStream*) Unexecuted instantiation: BaseURIMutator<mozilla::net::nsSimpleURI>::InitFromInputStream(nsIObjectInputStream*) Unexecuted instantiation: BaseURIMutator<mozilla::net::nsSimpleNestedURI>::InitFromInputStream(nsIObjectInputStream*) Unexecuted instantiation: BaseURIMutator<mozilla::net::nsNestedAboutURI>::InitFromInputStream(nsIObjectInputStream*) Unexecuted instantiation: BaseURIMutator<mozilla::dom::BlobURL>::InitFromInputStream(nsIObjectInputStream*) Unexecuted instantiation: BaseURIMutator<nsJARURI>::InitFromInputStream(nsIObjectInputStream*) Unexecuted instantiation: BaseURIMutator<nsJSURI>::InitFromInputStream(nsIObjectInputStream*) |
66 | | MOZ_MUST_USE nsresult InitFromIPCParams(const mozilla::ipc::URIParams& aParams) |
67 | 0 | { |
68 | 0 | RefPtr<T> uri = Create(); |
69 | 0 | bool ret = uri->Deserialize(aParams); |
70 | 0 | if (!ret) { |
71 | 0 | return NS_ERROR_FAILURE; |
72 | 0 | } |
73 | 0 | mURI = uri.forget(); |
74 | 0 | return NS_OK; |
75 | 0 | } Unexecuted instantiation: BaseURIMutator<mozilla::net::nsStandardURL>::InitFromIPCParams(mozilla::ipc::URIParams const&) Unexecuted instantiation: BaseURIMutator<mozilla::net::SubstitutingURL>::InitFromIPCParams(mozilla::ipc::URIParams const&) Unexecuted instantiation: BaseURIMutator<mozilla::net::nsSimpleURI>::InitFromIPCParams(mozilla::ipc::URIParams const&) Unexecuted instantiation: BaseURIMutator<mozilla::net::nsSimpleNestedURI>::InitFromIPCParams(mozilla::ipc::URIParams const&) Unexecuted instantiation: BaseURIMutator<mozilla::net::nsNestedAboutURI>::InitFromIPCParams(mozilla::ipc::URIParams const&) Unexecuted instantiation: BaseURIMutator<mozilla::dom::BlobURL>::InitFromIPCParams(mozilla::ipc::URIParams const&) Unexecuted instantiation: BaseURIMutator<mozilla::NullPrincipalURI>::InitFromIPCParams(mozilla::ipc::URIParams const&) Unexecuted instantiation: BaseURIMutator<nsJARURI>::InitFromIPCParams(mozilla::ipc::URIParams const&) Unexecuted instantiation: BaseURIMutator<nsJSURI>::InitFromIPCParams(mozilla::ipc::URIParams const&) Unexecuted instantiation: BaseURIMutator<nsMozIconURI>::InitFromIPCParams(mozilla::ipc::URIParams const&) |
76 | | MOZ_MUST_USE nsresult InitFromSpec(const nsACString& aSpec) |
77 | 1.92M | { |
78 | 1.92M | nsresult rv = NS_OK; |
79 | 1.92M | RefPtr<T> uri; |
80 | 1.92M | if (mURI) { |
81 | 768 | // This only works because all other Init methods create a new object |
82 | 768 | mURI.swap(uri); |
83 | 1.92M | } else { |
84 | 1.92M | uri = Create(); |
85 | 1.92M | } |
86 | 1.92M | rv = uri->SetSpecInternal(aSpec); |
87 | 1.92M | if (NS_FAILED(rv)) { |
88 | 91 | return rv; |
89 | 91 | } |
90 | 1.92M | mURI = uri.forget(); |
91 | 1.92M | return NS_OK; |
92 | 1.92M | } Unexecuted instantiation: BaseURIMutator<mozilla::net::nsStandardURL>::InitFromSpec(nsTSubstring<char> const&) Unexecuted instantiation: BaseURIMutator<mozilla::net::SubstitutingURL>::InitFromSpec(nsTSubstring<char> const&) BaseURIMutator<mozilla::net::nsSimpleURI>::InitFromSpec(nsTSubstring<char> const&) Line | Count | Source | 77 | 1.91M | { | 78 | 1.91M | nsresult rv = NS_OK; | 79 | 1.91M | RefPtr<T> uri; | 80 | 1.91M | if (mURI) { | 81 | 0 | // This only works because all other Init methods create a new object | 82 | 0 | mURI.swap(uri); | 83 | 1.91M | } else { | 84 | 1.91M | uri = Create(); | 85 | 1.91M | } | 86 | 1.91M | rv = uri->SetSpecInternal(aSpec); | 87 | 1.91M | if (NS_FAILED(rv)) { | 88 | 0 | return rv; | 89 | 0 | } | 90 | 1.91M | mURI = uri.forget(); | 91 | 1.91M | return NS_OK; | 92 | 1.91M | } |
Unexecuted instantiation: BaseURIMutator<mozilla::net::nsSimpleNestedURI>::InitFromSpec(nsTSubstring<char> const&) Unexecuted instantiation: BaseURIMutator<mozilla::net::nsNestedAboutURI>::InitFromSpec(nsTSubstring<char> const&) BaseURIMutator<mozilla::dom::BlobURL>::InitFromSpec(nsTSubstring<char> const&) Line | Count | Source | 77 | 1.77k | { | 78 | 1.77k | nsresult rv = NS_OK; | 79 | 1.77k | RefPtr<T> uri; | 80 | 1.77k | if (mURI) { | 81 | 0 | // This only works because all other Init methods create a new object | 82 | 0 | mURI.swap(uri); | 83 | 1.77k | } else { | 84 | 1.77k | uri = Create(); | 85 | 1.77k | } | 86 | 1.77k | rv = uri->SetSpecInternal(aSpec); | 87 | 1.77k | if (NS_FAILED(rv)) { | 88 | 0 | return rv; | 89 | 0 | } | 90 | 1.77k | mURI = uri.forget(); | 91 | 1.77k | return NS_OK; | 92 | 1.77k | } |
Unexecuted instantiation: BaseURIMutator<nsJARURI>::InitFromSpec(nsTSubstring<char> const&) BaseURIMutator<nsJSURI>::InitFromSpec(nsTSubstring<char> const&) Line | Count | Source | 77 | 768 | { | 78 | 768 | nsresult rv = NS_OK; | 79 | 768 | RefPtr<T> uri; | 80 | 768 | if (mURI) { | 81 | 768 | // This only works because all other Init methods create a new object | 82 | 768 | mURI.swap(uri); | 83 | 768 | } else { | 84 | 0 | uri = Create(); | 85 | 0 | } | 86 | 768 | rv = uri->SetSpecInternal(aSpec); | 87 | 768 | if (NS_FAILED(rv)) { | 88 | 91 | return rv; | 89 | 91 | } | 90 | 677 | mURI = uri.forget(); | 91 | 677 | return NS_OK; | 92 | 677 | } |
Unexecuted instantiation: BaseURIMutator<nsMozIconURI>::InitFromSpec(nsTSubstring<char> const&) |
93 | | RefPtr<T> mURI; |
94 | | }; |
95 | | // Since most implementations of nsIURIMutator would extend BaseURIMutator, |
96 | | // some methods would have the same implementation. We provide a useful macro |
97 | | // to avoid code duplication. |
98 | | #define NS_DEFINE_NSIMUTATOR_COMMON \ |
99 | | MOZ_MUST_USE NS_IMETHOD \ |
100 | | Deserialize(const mozilla::ipc::URIParams& aParams) override \ |
101 | 0 | { \ |
102 | 0 | return InitFromIPCParams(aParams); \ |
103 | 0 | } \ Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::Deserialize(mozilla::ipc::URIParams const&) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::Deserialize(mozilla::ipc::URIParams const&) Unexecuted instantiation: nsJARURI::Mutator::Deserialize(mozilla::ipc::URIParams const&) Unexecuted instantiation: nsJSURI::Mutator::Deserialize(mozilla::ipc::URIParams const&) |
104 | | \ |
105 | | MOZ_MUST_USE NS_IMETHOD \ |
106 | | Finalize(nsIURI** aURI) override \ |
107 | 1.92M | { \ |
108 | 1.92M | mURI.forget(aURI); return NS_OK; \ |
109 | 1.92M | } \ mozilla::net::nsSimpleURI::Mutator::Finalize(nsIURI**) Line | Count | Source | 107 | 1.91M | { \ | 108 | 1.91M | mURI.forget(aURI); return NS_OK; \ | 109 | 1.91M | } \ |
mozilla::dom::BlobURL::Mutator::Finalize(nsIURI**) Line | Count | Source | 107 | 1.77k | { \ | 108 | 1.77k | mURI.forget(aURI); return NS_OK; \ | 109 | 1.77k | } \ |
nsJARURI::Mutator::Finalize(nsIURI**) Line | Count | Source | 107 | 2.31k | { \ | 108 | 2.31k | mURI.forget(aURI); return NS_OK; \ | 109 | 2.31k | } \ |
nsJSURI::Mutator::Finalize(nsIURI**) Line | Count | Source | 107 | 677 | { \ | 108 | 677 | mURI.forget(aURI); return NS_OK; \ | 109 | 677 | } \ |
|
110 | | \ |
111 | | MOZ_MUST_USE NS_IMETHOD \ |
112 | | SetSpec(const nsACString& aSpec, nsIURIMutator** aMutator) override \ |
113 | 1.92M | { \ |
114 | 1.92M | if (aMutator) NS_ADDREF(*aMutator = this); \ |
115 | 1.92M | return InitFromSpec(aSpec); \ |
116 | 1.92M | } \ mozilla::net::nsSimpleURI::Mutator::SetSpec(nsTSubstring<char> const&, nsIURIMutator**) Line | Count | Source | 113 | 1.91M | { \ | 114 | 1.91M | if (aMutator) NS_ADDREF(*aMutator = this); \ | 115 | 1.91M | return InitFromSpec(aSpec); \ | 116 | 1.91M | } \ |
mozilla::dom::BlobURL::Mutator::SetSpec(nsTSubstring<char> const&, nsIURIMutator**) Line | Count | Source | 113 | 1.77k | { \ | 114 | 1.77k | if (aMutator) NS_ADDREF(*aMutator = this); \ | 115 | 1.77k | return InitFromSpec(aSpec); \ | 116 | 1.77k | } \ |
Unexecuted instantiation: nsJARURI::Mutator::SetSpec(nsTSubstring<char> const&, nsIURIMutator**) nsJSURI::Mutator::SetSpec(nsTSubstring<char> const&, nsIURIMutator**) Line | Count | Source | 113 | 768 | { \ | 114 | 768 | if (aMutator) NS_ADDREF(*aMutator = this); \ | 115 | 768 | return InitFromSpec(aSpec); \ | 116 | 768 | } \ |
|
117 | | // Implements AddRef, Release and QueryInterface for the mutator |
118 | | #define NS_IMPL_NSIURIMUTATOR_ISUPPORTS(aClass, ...) \ |
119 | | NS_IMPL_ADDREF(aClass) \ |
120 | | NS_IMPL_RELEASE(aClass) \ |
121 | | NS_IMPL_NSIURIMUTATOR_QUERY_INTERFACE(aClass, __VA_ARGS__) \ |
122 | | // The list of interfaces is queried and an AddRef-ed pointer is returned if |
123 | | // there is a match. Otherwise, we call QueryInterface on mURI and return. |
124 | | // The reason for this specialized QueryInterface implementation is that we |
125 | | // we want to be able to instantiate the mutator for a given CID of a |
126 | | // nsIURI implementation, call nsISerializable.Read() on the mutator to |
127 | | // deserialize the URI then QueryInterface the mutator to an nsIURI interface. |
128 | | // See bug 1442239. |
129 | | // If you QueryInterface a mutator to an interface of the URI |
130 | | // implementation this is similar to calling Finalize. |
131 | | #define NS_IMPL_NSIURIMUTATOR_QUERY_INTERFACE(aClass, ...) \ |
132 | | static_assert(MOZ_ARG_COUNT(__VA_ARGS__) > 0, \ |
133 | | "Need more arguments"); \ |
134 | 22.4M | NS_INTERFACE_MAP_BEGIN(aClass) \ |
135 | 22.4M | nsCOMPtr<nsIURI> uri; \ |
136 | 22.4M | NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIURIMutator) \ |
137 | 54.1M | MOZ_FOR_EACH(NS_INTERFACE_MAP_ENTRY, (), (__VA_ARGS__)) \ |
138 | 54.1M | if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { \ |
139 | 3.24M | foundInterface = nullptr; \ |
140 | 3.24M | } else \ |
141 | 14.5M | if (mURI && \ |
142 | 11.2M | NS_SUCCEEDED(mURI->QueryInterface(aIID, getter_AddRefs(uri)))) { \ |
143 | 0 | mURI = nullptr; \ |
144 | 0 | foundInterface = uri.get(); \ |
145 | 0 | } else \ |
146 | 11.2M | NS_INTERFACE_MAP_END \ Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::QueryInterface(nsID const&, void**) mozilla::net::nsSimpleURI::Mutator::QueryInterface(nsID const&, void**) Line | Count | Source | 134 | 21.3M | NS_INTERFACE_MAP_BEGIN(aClass) \ | 135 | 21.3M | nsCOMPtr<nsIURI> uri; \ | 136 | 21.3M | NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIURIMutator) \ | 137 | 50.7M | MOZ_FOR_EACH(NS_INTERFACE_MAP_ENTRY, (), (__VA_ARGS__)) \ | 138 | 50.7M | if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { \ | 139 | 3.24M | foundInterface = nullptr; \ | 140 | 3.24M | } else \ | 141 | 14.5M | if (mURI && \ | 142 | 11.2M | NS_SUCCEEDED(mURI->QueryInterface(aIID, getter_AddRefs(uri)))) { \ | 143 | 0 | mURI = nullptr; \ | 144 | 0 | foundInterface = uri.get(); \ | 145 | 0 | } else \ | 146 | 11.2M | NS_INTERFACE_MAP_END \ |
mozilla::net::nsStandardURL::Mutator::QueryInterface(nsID const&, void**) Line | Count | Source | 134 | 1.13M | NS_INTERFACE_MAP_BEGIN(aClass) \ | 135 | 1.13M | nsCOMPtr<nsIURI> uri; \ | 136 | 1.13M | NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIURIMutator) \ | 137 | 3.40M | MOZ_FOR_EACH(NS_INTERFACE_MAP_ENTRY, (), (__VA_ARGS__)) \ | 138 | 3.40M | if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { \ | 139 | 0 | foundInterface = nullptr; \ | 140 | 0 | } else \ | 141 | 0 | if (mURI && \ | 142 | 0 | NS_SUCCEEDED(mURI->QueryInterface(aIID, getter_AddRefs(uri)))) { \ | 143 | 0 | mURI = nullptr; \ | 144 | 0 | foundInterface = uri.get(); \ | 145 | 0 | } else \ | 146 | 0 | NS_INTERFACE_MAP_END \ |
Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::QueryInterface(nsID const&, void**) mozilla::net::SubstitutingURL::Mutator::QueryInterface(nsID const&, void**) Line | Count | Source | 134 | 2.57k | NS_INTERFACE_MAP_BEGIN(aClass) \ | 135 | 2.57k | nsCOMPtr<nsIURI> uri; \ | 136 | 2.57k | NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIURIMutator) \ | 137 | 7.73k | MOZ_FOR_EACH(NS_INTERFACE_MAP_ENTRY, (), (__VA_ARGS__)) \ | 138 | 7.73k | if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { \ | 139 | 0 | foundInterface = nullptr; \ | 140 | 0 | } else \ | 141 | 0 | if (mURI && \ | 142 | 0 | NS_SUCCEEDED(mURI->QueryInterface(aIID, getter_AddRefs(uri)))) { \ | 143 | 0 | mURI = nullptr; \ | 144 | 0 | foundInterface = uri.get(); \ | 145 | 0 | } else \ | 146 | 0 | NS_INTERFACE_MAP_END \ |
nsJARURI::Mutator::QueryInterface(nsID const&, void**) Line | Count | Source | 134 | 5.35k | NS_INTERFACE_MAP_BEGIN(aClass) \ | 135 | 5.35k | nsCOMPtr<nsIURI> uri; \ | 136 | 5.35k | NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIURIMutator) \ | 137 | 26.7k | MOZ_FOR_EACH(NS_INTERFACE_MAP_ENTRY, (), (__VA_ARGS__)) \ | 138 | 26.7k | if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { \ | 139 | 0 | foundInterface = nullptr; \ | 140 | 0 | } else \ | 141 | 0 | if (mURI && \ | 142 | 0 | NS_SUCCEEDED(mURI->QueryInterface(aIID, getter_AddRefs(uri)))) { \ | 143 | 0 | mURI = nullptr; \ | 144 | 0 | foundInterface = uri.get(); \ | 145 | 0 | } else \ | 146 | 0 | NS_INTERFACE_MAP_END \ |
Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::QueryInterface(nsID const&, void**) nsJSURI::Mutator::QueryInterface(nsID const&, void**) Line | Count | Source | 134 | 1.79k | NS_INTERFACE_MAP_BEGIN(aClass) \ | 135 | 1.79k | nsCOMPtr<nsIURI> uri; \ | 136 | 1.79k | NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIURIMutator) \ | 137 | 7.19k | MOZ_FOR_EACH(NS_INTERFACE_MAP_ENTRY, (), (__VA_ARGS__)) \ | 138 | 7.19k | if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { \ | 139 | 0 | foundInterface = nullptr; \ | 140 | 0 | } else \ | 141 | 0 | if (mURI && \ | 142 | 0 | NS_SUCCEEDED(mURI->QueryInterface(aIID, getter_AddRefs(uri)))) { \ | 143 | 0 | mURI = nullptr; \ | 144 | 0 | foundInterface = uri.get(); \ | 145 | 0 | } else \ | 146 | 0 | NS_INTERFACE_MAP_END \ |
|
147 | | |
148 | | /* starting interface: nsIURISetSpec */ |
149 | | #define NS_IURISETSPEC_IID_STR "1fc53257-898b-4c5e-b69c-05bc84b4cd8f" |
150 | | |
151 | | #define NS_IURISETSPEC_IID \ |
152 | | {0x1fc53257, 0x898b, 0x4c5e, \ |
153 | | { 0xb6, 0x9c, 0x05, 0xbc, 0x84, 0xb4, 0xcd, 0x8f }} |
154 | | |
155 | | class NS_NO_VTABLE nsIURISetSpec : public nsISupports { |
156 | | public: |
157 | | |
158 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IURISETSPEC_IID) |
159 | | |
160 | | /* [must_use] nsIURIMutator setSpec (in AUTF8String aSpec); */ |
161 | | MOZ_MUST_USE NS_IMETHOD SetSpec(const nsACString& aSpec, nsIURIMutator **_retval) = 0; |
162 | | |
163 | | }; |
164 | | |
165 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIURISetSpec, NS_IURISETSPEC_IID) |
166 | | |
167 | | /* Use this macro when declaring classes that implement this interface. */ |
168 | | #define NS_DECL_NSIURISETSPEC \ |
169 | | MOZ_MUST_USE NS_IMETHOD SetSpec(const nsACString& aSpec, nsIURIMutator **_retval) override; |
170 | | |
171 | | /* Use this macro when declaring the members of this interface when the |
172 | | class doesn't implement the interface. This is useful for forwarding. */ |
173 | | #define NS_DECL_NON_VIRTUAL_NSIURISETSPEC \ |
174 | | MOZ_MUST_USE nsresult SetSpec(const nsACString& aSpec, nsIURIMutator **_retval); |
175 | | |
176 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
177 | | #define NS_FORWARD_NSIURISETSPEC(_to) \ |
178 | | MOZ_MUST_USE NS_IMETHOD SetSpec(const nsACString& aSpec, nsIURIMutator **_retval) override { return _to SetSpec(aSpec, _retval); } |
179 | | |
180 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
181 | | #define NS_FORWARD_SAFE_NSIURISETSPEC(_to) \ |
182 | | MOZ_MUST_USE NS_IMETHOD SetSpec(const nsACString& aSpec, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSpec(aSpec, _retval); } |
183 | | |
184 | | |
185 | | /* starting interface: nsIURISetters */ |
186 | | #define NS_IURISETTERS_IID_STR "5403a6ec-99d7-405e-8b45-9f805bbdfcef" |
187 | | |
188 | | #define NS_IURISETTERS_IID \ |
189 | | {0x5403a6ec, 0x99d7, 0x405e, \ |
190 | | { 0x8b, 0x45, 0x9f, 0x80, 0x5b, 0xbd, 0xfc, 0xef }} |
191 | | |
192 | | class NS_NO_VTABLE nsIURISetters : public nsIURISetSpec { |
193 | | public: |
194 | | |
195 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IURISETTERS_IID) |
196 | | |
197 | | /* [must_use] nsIURIMutator setScheme (in AUTF8String aScheme); */ |
198 | | MOZ_MUST_USE NS_IMETHOD SetScheme(const nsACString& aScheme, nsIURIMutator **_retval) = 0; |
199 | | |
200 | | /* [must_use] nsIURIMutator setUserPass (in AUTF8String aUserPass); */ |
201 | | MOZ_MUST_USE NS_IMETHOD SetUserPass(const nsACString& aUserPass, nsIURIMutator **_retval) = 0; |
202 | | |
203 | | /* [must_use] nsIURIMutator setUsername (in AUTF8String aUsername); */ |
204 | | MOZ_MUST_USE NS_IMETHOD SetUsername(const nsACString& aUsername, nsIURIMutator **_retval) = 0; |
205 | | |
206 | | /* [must_use] nsIURIMutator setPassword (in AUTF8String aPassword); */ |
207 | | MOZ_MUST_USE NS_IMETHOD SetPassword(const nsACString& aPassword, nsIURIMutator **_retval) = 0; |
208 | | |
209 | | /* [must_use] nsIURIMutator setHostPort (in AUTF8String aHostPort); */ |
210 | | MOZ_MUST_USE NS_IMETHOD SetHostPort(const nsACString& aHostPort, nsIURIMutator **_retval) = 0; |
211 | | |
212 | | /* [must_use] nsIURIMutator setHost (in AUTF8String aHost); */ |
213 | | MOZ_MUST_USE NS_IMETHOD SetHost(const nsACString& aHost, nsIURIMutator **_retval) = 0; |
214 | | |
215 | | /* [must_use] nsIURIMutator setPort (in long aPort); */ |
216 | | MOZ_MUST_USE NS_IMETHOD SetPort(int32_t aPort, nsIURIMutator **_retval) = 0; |
217 | | |
218 | | /* [must_use] nsIURIMutator setPathQueryRef (in AUTF8String aPathQueryRef); */ |
219 | | MOZ_MUST_USE NS_IMETHOD SetPathQueryRef(const nsACString& aPathQueryRef, nsIURIMutator **_retval) = 0; |
220 | | |
221 | | /* [must_use] nsIURIMutator setRef (in AUTF8String aRef); */ |
222 | | MOZ_MUST_USE NS_IMETHOD SetRef(const nsACString& aRef, nsIURIMutator **_retval) = 0; |
223 | | |
224 | | /* [must_use] nsIURIMutator setFilePath (in AUTF8String aFilePath); */ |
225 | | MOZ_MUST_USE NS_IMETHOD SetFilePath(const nsACString& aFilePath, nsIURIMutator **_retval) = 0; |
226 | | |
227 | | /* [must_use] nsIURIMutator setQuery (in AUTF8String aQuery); */ |
228 | | MOZ_MUST_USE NS_IMETHOD SetQuery(const nsACString& aQuery, nsIURIMutator **_retval) = 0; |
229 | | |
230 | | /* [must_use,noscript] nsIURIMutator setQueryWithEncoding (in AUTF8String query, in Encoding encoding); */ |
231 | | MOZ_MUST_USE NS_IMETHOD SetQueryWithEncoding(const nsACString& query, const mozilla::Encoding * encoding, nsIURIMutator **_retval) = 0; |
232 | | |
233 | | }; |
234 | | |
235 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIURISetters, NS_IURISETTERS_IID) |
236 | | |
237 | | /* Use this macro when declaring classes that implement this interface. */ |
238 | | #define NS_DECL_NSIURISETTERS \ |
239 | | MOZ_MUST_USE NS_IMETHOD SetScheme(const nsACString& aScheme, nsIURIMutator **_retval) override; \ |
240 | | MOZ_MUST_USE NS_IMETHOD SetUserPass(const nsACString& aUserPass, nsIURIMutator **_retval) override; \ |
241 | | MOZ_MUST_USE NS_IMETHOD SetUsername(const nsACString& aUsername, nsIURIMutator **_retval) override; \ |
242 | | MOZ_MUST_USE NS_IMETHOD SetPassword(const nsACString& aPassword, nsIURIMutator **_retval) override; \ |
243 | | MOZ_MUST_USE NS_IMETHOD SetHostPort(const nsACString& aHostPort, nsIURIMutator **_retval) override; \ |
244 | | MOZ_MUST_USE NS_IMETHOD SetHost(const nsACString& aHost, nsIURIMutator **_retval) override; \ |
245 | | MOZ_MUST_USE NS_IMETHOD SetPort(int32_t aPort, nsIURIMutator **_retval) override; \ |
246 | | MOZ_MUST_USE NS_IMETHOD SetPathQueryRef(const nsACString& aPathQueryRef, nsIURIMutator **_retval) override; \ |
247 | | MOZ_MUST_USE NS_IMETHOD SetRef(const nsACString& aRef, nsIURIMutator **_retval) override; \ |
248 | | MOZ_MUST_USE NS_IMETHOD SetFilePath(const nsACString& aFilePath, nsIURIMutator **_retval) override; \ |
249 | | MOZ_MUST_USE NS_IMETHOD SetQuery(const nsACString& aQuery, nsIURIMutator **_retval) override; \ |
250 | | MOZ_MUST_USE NS_IMETHOD SetQueryWithEncoding(const nsACString& query, const mozilla::Encoding * encoding, nsIURIMutator **_retval) override; |
251 | | |
252 | | /* Use this macro when declaring the members of this interface when the |
253 | | class doesn't implement the interface. This is useful for forwarding. */ |
254 | | #define NS_DECL_NON_VIRTUAL_NSIURISETTERS \ |
255 | | MOZ_MUST_USE nsresult SetScheme(const nsACString& aScheme, nsIURIMutator **_retval); \ |
256 | | MOZ_MUST_USE nsresult SetUserPass(const nsACString& aUserPass, nsIURIMutator **_retval); \ |
257 | | MOZ_MUST_USE nsresult SetUsername(const nsACString& aUsername, nsIURIMutator **_retval); \ |
258 | | MOZ_MUST_USE nsresult SetPassword(const nsACString& aPassword, nsIURIMutator **_retval); \ |
259 | | MOZ_MUST_USE nsresult SetHostPort(const nsACString& aHostPort, nsIURIMutator **_retval); \ |
260 | | MOZ_MUST_USE nsresult SetHost(const nsACString& aHost, nsIURIMutator **_retval); \ |
261 | | MOZ_MUST_USE nsresult SetPort(int32_t aPort, nsIURIMutator **_retval); \ |
262 | | MOZ_MUST_USE nsresult SetPathQueryRef(const nsACString& aPathQueryRef, nsIURIMutator **_retval); \ |
263 | | MOZ_MUST_USE nsresult SetRef(const nsACString& aRef, nsIURIMutator **_retval); \ |
264 | | MOZ_MUST_USE nsresult SetFilePath(const nsACString& aFilePath, nsIURIMutator **_retval); \ |
265 | | MOZ_MUST_USE nsresult SetQuery(const nsACString& aQuery, nsIURIMutator **_retval); \ |
266 | | MOZ_MUST_USE nsresult SetQueryWithEncoding(const nsACString& query, const mozilla::Encoding * encoding, nsIURIMutator **_retval); |
267 | | |
268 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
269 | | #define NS_FORWARD_NSIURISETTERS(_to) \ |
270 | | MOZ_MUST_USE NS_IMETHOD SetScheme(const nsACString& aScheme, nsIURIMutator **_retval) override { return _to SetScheme(aScheme, _retval); } \ |
271 | | MOZ_MUST_USE NS_IMETHOD SetUserPass(const nsACString& aUserPass, nsIURIMutator **_retval) override { return _to SetUserPass(aUserPass, _retval); } \ |
272 | | MOZ_MUST_USE NS_IMETHOD SetUsername(const nsACString& aUsername, nsIURIMutator **_retval) override { return _to SetUsername(aUsername, _retval); } \ |
273 | | MOZ_MUST_USE NS_IMETHOD SetPassword(const nsACString& aPassword, nsIURIMutator **_retval) override { return _to SetPassword(aPassword, _retval); } \ |
274 | | MOZ_MUST_USE NS_IMETHOD SetHostPort(const nsACString& aHostPort, nsIURIMutator **_retval) override { return _to SetHostPort(aHostPort, _retval); } \ |
275 | | MOZ_MUST_USE NS_IMETHOD SetHost(const nsACString& aHost, nsIURIMutator **_retval) override { return _to SetHost(aHost, _retval); } \ |
276 | | MOZ_MUST_USE NS_IMETHOD SetPort(int32_t aPort, nsIURIMutator **_retval) override { return _to SetPort(aPort, _retval); } \ |
277 | | MOZ_MUST_USE NS_IMETHOD SetPathQueryRef(const nsACString& aPathQueryRef, nsIURIMutator **_retval) override { return _to SetPathQueryRef(aPathQueryRef, _retval); } \ |
278 | | MOZ_MUST_USE NS_IMETHOD SetRef(const nsACString& aRef, nsIURIMutator **_retval) override { return _to SetRef(aRef, _retval); } \ |
279 | | MOZ_MUST_USE NS_IMETHOD SetFilePath(const nsACString& aFilePath, nsIURIMutator **_retval) override { return _to SetFilePath(aFilePath, _retval); } \ |
280 | | MOZ_MUST_USE NS_IMETHOD SetQuery(const nsACString& aQuery, nsIURIMutator **_retval) override { return _to SetQuery(aQuery, _retval); } \ |
281 | | MOZ_MUST_USE NS_IMETHOD SetQueryWithEncoding(const nsACString& query, const mozilla::Encoding * encoding, nsIURIMutator **_retval) override { return _to SetQueryWithEncoding(query, encoding, _retval); } |
282 | | |
283 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
284 | | #define NS_FORWARD_SAFE_NSIURISETTERS(_to) \ |
285 | | MOZ_MUST_USE NS_IMETHOD SetScheme(const nsACString& aScheme, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetScheme(aScheme, _retval); } \ |
286 | | MOZ_MUST_USE NS_IMETHOD SetUserPass(const nsACString& aUserPass, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUserPass(aUserPass, _retval); } \ |
287 | | MOZ_MUST_USE NS_IMETHOD SetUsername(const nsACString& aUsername, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUsername(aUsername, _retval); } \ |
288 | | MOZ_MUST_USE NS_IMETHOD SetPassword(const nsACString& aPassword, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPassword(aPassword, _retval); } \ |
289 | | MOZ_MUST_USE NS_IMETHOD SetHostPort(const nsACString& aHostPort, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetHostPort(aHostPort, _retval); } \ |
290 | | MOZ_MUST_USE NS_IMETHOD SetHost(const nsACString& aHost, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetHost(aHost, _retval); } \ |
291 | | MOZ_MUST_USE NS_IMETHOD SetPort(int32_t aPort, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPort(aPort, _retval); } \ |
292 | | MOZ_MUST_USE NS_IMETHOD SetPathQueryRef(const nsACString& aPathQueryRef, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPathQueryRef(aPathQueryRef, _retval); } \ |
293 | | MOZ_MUST_USE NS_IMETHOD SetRef(const nsACString& aRef, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRef(aRef, _retval); } \ |
294 | | MOZ_MUST_USE NS_IMETHOD SetFilePath(const nsACString& aFilePath, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFilePath(aFilePath, _retval); } \ |
295 | | MOZ_MUST_USE NS_IMETHOD SetQuery(const nsACString& aQuery, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetQuery(aQuery, _retval); } \ |
296 | | MOZ_MUST_USE NS_IMETHOD SetQueryWithEncoding(const nsACString& query, const mozilla::Encoding * encoding, nsIURIMutator **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetQueryWithEncoding(query, encoding, _retval); } |
297 | | |
298 | | |
299 | | // Using this macro instead of NS_FORWARD_SAFE_NSIURISETTERS makes chaining |
300 | | // setter operations possible. |
301 | | #define NS_FORWARD_SAFE_NSIURISETTERS_RET(_to) \ |
302 | | MOZ_MUST_USE NS_IMETHOD \ |
303 | | SetScheme(const nsACString& aScheme, nsIURIMutator** aMutator) override \ |
304 | 0 | { \ |
305 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
306 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetScheme(aScheme); \ |
307 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetScheme(nsTSubstring<char> const&, nsIURIMutator**) |
308 | | MOZ_MUST_USE NS_IMETHOD \ |
309 | | SetUserPass(const nsACString& aUserPass, nsIURIMutator** aMutator) override \ |
310 | 0 | { \ |
311 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
312 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetUserPass(aUserPass); \ |
313 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) |
314 | | MOZ_MUST_USE NS_IMETHOD \ |
315 | | SetUsername(const nsACString& aUsername, nsIURIMutator** aMutator) override \ |
316 | 0 | { \ |
317 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
318 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetUsername(aUsername); \ |
319 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetUsername(nsTSubstring<char> const&, nsIURIMutator**) |
320 | | MOZ_MUST_USE NS_IMETHOD \ |
321 | | SetPassword(const nsACString& aPassword, nsIURIMutator** aMutator) override \ |
322 | 0 | { \ |
323 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
324 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetPassword(aPassword); \ |
325 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetPassword(nsTSubstring<char> const&, nsIURIMutator**) |
326 | | MOZ_MUST_USE NS_IMETHOD \ |
327 | | SetHostPort(const nsACString& aHostPort, nsIURIMutator** aMutator) override \ |
328 | 0 | { \ |
329 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
330 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetHostPort(aHostPort); \ |
331 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetHostPort(nsTSubstring<char> const&, nsIURIMutator**) |
332 | | MOZ_MUST_USE NS_IMETHOD \ |
333 | | SetHost(const nsACString& aHost, nsIURIMutator** aMutator) override \ |
334 | 0 | { \ |
335 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
336 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetHost(aHost); \ |
337 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetHost(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetHost(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetHost(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetHost(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetHost(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetHost(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetHost(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetHost(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetHost(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetHost(nsTSubstring<char> const&, nsIURIMutator**) |
338 | | MOZ_MUST_USE NS_IMETHOD \ |
339 | | SetPort(int32_t aPort, nsIURIMutator** aMutator) override \ |
340 | 0 | { \ |
341 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
342 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetPort(aPort); \ |
343 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetPort(int, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetPort(int, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetPort(int, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetPort(int, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetPort(int, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetPort(int, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetPort(int, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetPort(int, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetPort(int, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetPort(int, nsIURIMutator**) |
344 | | MOZ_MUST_USE NS_IMETHOD \ |
345 | | SetPathQueryRef(const nsACString& aPathQueryRef, nsIURIMutator** aMutator) override \ |
346 | 1.59k | { \ |
347 | 1.59k | if (aMutator) NS_ADDREF(*aMutator = this); \ |
348 | 1.59k | return !_to ? NS_ERROR_NULL_POINTER : _to->SetPathQueryRef(aPathQueryRef); \ |
349 | 1.59k | } \ mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) Line | Count | Source | 346 | 1.59k | { \ | 347 | 1.59k | if (aMutator) NS_ADDREF(*aMutator = this); \ | 348 | 1.59k | return !_to ? NS_ERROR_NULL_POINTER : _to->SetPathQueryRef(aPathQueryRef); \ | 349 | 1.59k | } \ |
Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetPathQueryRef(nsTSubstring<char> const&, nsIURIMutator**) |
350 | | MOZ_MUST_USE NS_IMETHOD \ |
351 | | SetRef(const nsACString& aRef, nsIURIMutator** aMutator) override \ |
352 | 2.32k | { \ |
353 | 2.32k | if (aMutator) NS_ADDREF(*aMutator = this); \ |
354 | 2.32k | return !_to ? NS_ERROR_NULL_POINTER : _to->SetRef(aRef); \ |
355 | 2.32k | } \ mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetRef(nsTSubstring<char> const&, nsIURIMutator**) Line | Count | Source | 352 | 2.32k | { \ | 353 | 2.32k | if (aMutator) NS_ADDREF(*aMutator = this); \ | 354 | 2.32k | return !_to ? NS_ERROR_NULL_POINTER : _to->SetRef(aRef); \ | 355 | 2.32k | } \ |
Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetRef(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetRef(nsTSubstring<char> const&, nsIURIMutator**) |
356 | | MOZ_MUST_USE NS_IMETHOD \ |
357 | | SetFilePath(const nsACString& aFilePath, nsIURIMutator** aMutator) override \ |
358 | 0 | { \ |
359 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
360 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetFilePath(aFilePath); \ |
361 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetFilePath(nsTSubstring<char> const&, nsIURIMutator**) |
362 | | MOZ_MUST_USE NS_IMETHOD \ |
363 | | SetQuery(const nsACString& aQuery, nsIURIMutator** aMutator) override \ |
364 | 0 | { \ |
365 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
366 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetQuery(aQuery); \ |
367 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetQuery(nsTSubstring<char> const&, nsIURIMutator**) |
368 | | MOZ_MUST_USE NS_IMETHOD \ |
369 | | SetQueryWithEncoding(const nsACString& query, const mozilla::Encoding *encoding, nsIURIMutator** aMutator) override \ |
370 | 0 | { \ |
371 | 0 | if (aMutator) NS_ADDREF(*aMutator = this); \ |
372 | 0 | return !_to ? NS_ERROR_NULL_POINTER : _to->SetQueryWithEncoding(query, encoding); \ |
373 | 0 | } \ Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::SubstitutingURL>::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleURI::Mutator::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsSimpleNestedURI::Mutator::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) Unexecuted instantiation: mozilla::net::nsNestedAboutURI::Mutator::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) Unexecuted instantiation: mozilla::dom::BlobURL::Mutator::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) Unexecuted instantiation: mozilla::NullPrincipalURI::Mutator::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) Unexecuted instantiation: nsJARURI::Mutator::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) Unexecuted instantiation: nsJSURI::Mutator::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) Unexecuted instantiation: nsMozIconURI::Mutator::SetQueryWithEncoding(nsTSubstring<char> const&, mozilla::Encoding const*, nsIURIMutator**) |
374 | | |
375 | | /* starting interface: nsIURIMutator */ |
376 | | #define NS_IURIMUTATOR_IID_STR "4d1f3103-1c44-4dcd-b717-5d22a697a7d9" |
377 | | |
378 | | #define NS_IURIMUTATOR_IID \ |
379 | | {0x4d1f3103, 0x1c44, 0x4dcd, \ |
380 | | { 0xb7, 0x17, 0x5d, 0x22, 0xa6, 0x97, 0xa7, 0xd9 }} |
381 | | |
382 | | class NS_NO_VTABLE nsIURIMutator : public nsIURISetters { |
383 | | public: |
384 | | |
385 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IURIMUTATOR_IID) |
386 | | |
387 | | /* [must_use,noscript,notxpcom] nsresult deserialize (in const_URIParams_ref aParams); */ |
388 | | MOZ_MUST_USE NS_IMETHOD_(nsresult) Deserialize(const mozilla::ipc::URIParams & aParams) = 0; |
389 | | |
390 | | /* [must_use] nsIURI finalize (); */ |
391 | | MOZ_MUST_USE NS_IMETHOD Finalize(nsIURI **_retval) = 0; |
392 | | |
393 | | }; |
394 | | |
395 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIURIMutator, NS_IURIMUTATOR_IID) |
396 | | |
397 | | /* Use this macro when declaring classes that implement this interface. */ |
398 | | #define NS_DECL_NSIURIMUTATOR \ |
399 | | MOZ_MUST_USE NS_IMETHOD_(nsresult) Deserialize(const mozilla::ipc::URIParams & aParams) override; \ |
400 | | MOZ_MUST_USE NS_IMETHOD Finalize(nsIURI **_retval) override; |
401 | | |
402 | | /* Use this macro when declaring the members of this interface when the |
403 | | class doesn't implement the interface. This is useful for forwarding. */ |
404 | | #define NS_DECL_NON_VIRTUAL_NSIURIMUTATOR \ |
405 | | MOZ_MUST_USE nsresult_(nsresult) Deserialize(const mozilla::ipc::URIParams & aParams); \ |
406 | | MOZ_MUST_USE nsresult Finalize(nsIURI **_retval); |
407 | | |
408 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
409 | | #define NS_FORWARD_NSIURIMUTATOR(_to) \ |
410 | | MOZ_MUST_USE NS_IMETHOD_(nsresult) Deserialize(const mozilla::ipc::URIParams & aParams) override { return _to Deserialize(aParams); } \ |
411 | | MOZ_MUST_USE NS_IMETHOD Finalize(nsIURI **_retval) override { return _to Finalize(_retval); } |
412 | | |
413 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
414 | | #define NS_FORWARD_SAFE_NSIURIMUTATOR(_to) \ |
415 | | MOZ_MUST_USE NS_IMETHOD_(nsresult) Deserialize(const mozilla::ipc::URIParams & aParams) override; \ |
416 | | MOZ_MUST_USE NS_IMETHOD Finalize(nsIURI **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Finalize(_retval); } |
417 | | |
418 | | |
419 | | // This templated struct is used to extract the class type of the method |
420 | | // passed to NS_MutatorMethod. |
421 | | template <typename Method> |
422 | | struct nsMethodTypeTraits; |
423 | | template <class C, typename R, typename... As> |
424 | | struct nsMethodTypeTraits<R(C::*)(As...)> |
425 | | { |
426 | | typedef C class_type; |
427 | | }; |
428 | | #ifdef NS_HAVE_STDCALL |
429 | | template <class C, typename R, typename... As> |
430 | | struct nsMethodTypeTraits<R(__stdcall C::*)(As...)> |
431 | | { |
432 | | typedef C class_type; |
433 | | }; |
434 | | #endif |
435 | | // This helper returns a std::function that will be applied on the |
436 | | // nsIURIMutator. The type of `Interface` will be deduced from the method type. |
437 | | // aMethod will be called on the target object if it successfully QIs to |
438 | | // `Interface`, and the arguments will be passed to the call. |
439 | | template <typename Method, typename... Args> |
440 | | const std::function<nsresult(nsIURIMutator*)> |
441 | | NS_MutatorMethod(Method aMethod, Args ...aArgs) |
442 | 1.13M | { |
443 | 1.13M | // Capture arguments by value, otherwise we crash. |
444 | 1.13M | return [=](nsIURIMutator* aMutator) { |
445 | 1.13M | typedef typename nsMethodTypeTraits<Method>::class_type Interface; |
446 | 1.13M | nsresult rv; |
447 | 1.13M | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); |
448 | 1.13M | NS_ENSURE_SUCCESS(rv, rv); |
449 | 1.13M | rv = (target->*aMethod)(aArgs...); |
450 | 1.13M | NS_ENSURE_SUCCESS(rv, rv); |
451 | 1.13M | return NS_OK; |
452 | 1.13M | }; std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, char const*, nsCOMPtr<nsIURI>, decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, char const*, nsCOMPtr<nsIURI>, decltype(nullptr))::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Line | Count | Source | 444 | 1.11M | return [=](nsIURIMutator* aMutator) { | 445 | 1.11M | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 1.11M | nsresult rv; | 447 | 1.11M | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 1.11M | NS_ENSURE_SUCCESS(rv, rv); | 449 | 1.11M | rv = (target->*aMethod)(aArgs...); | 450 | 1.11M | NS_ENSURE_SUCCESS(rv, rv); | 451 | 1.11M | return NS_OK; | 452 | 1.11M | }; |
Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(int, nsIURIMutator**), int, decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(int, nsIURIMutator**), int, decltype(nullptr))::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, decltype(nullptr), decltype(nullptr), decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, decltype(nullptr), decltype(nullptr), decltype(nullptr))::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsINestedAboutURIMutator::*)(nsIURI*, nsIURI*), nsCOMPtr<nsIURI>, nsCOMPtr<nsIURI> >(nsresult (nsINestedAboutURIMutator::*)(nsIURI*, nsIURI*), nsCOMPtr<nsIURI>, nsCOMPtr<nsIURI>)::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIFileURLMutator::*)()>(nsresult (nsIFileURLMutator::*)())::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Line | Count | Source | 444 | 4.68k | return [=](nsIURIMutator* aMutator) { | 445 | 4.68k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 4.68k | nsresult rv; | 447 | 4.68k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 4.68k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 4.68k | rv = (target->*aMethod)(aArgs...); | 450 | 4.68k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 4.68k | return NS_OK; | 452 | 4.68k | }; |
std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTAutoStringN<char, 64ul>, char const*, nsCOMPtr<nsIURI>, decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTAutoStringN<char, 64ul>, char const*, nsCOMPtr<nsIURI>, decltype(nullptr))::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Line | Count | Source | 444 | 7.26k | return [=](nsIURIMutator* aMutator) { | 445 | 7.26k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 7.26k | nsresult rv; | 447 | 7.26k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 7.26k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 7.26k | rv = (target->*aMethod)(aArgs...); | 450 | 7.26k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 7.26k | return NS_OK; | 452 | 7.26k | }; |
Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIFileURLMutator::*)(nsIFile*), RefPtr<nsIFile> >(nsresult (nsIFileURLMutator::*)(nsIFile*), RefPtr<nsIFile>)::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsINestedURIMutator::*)(nsIURI*), nsCOMPtr<nsIURI> >(nsresult (nsINestedURIMutator::*)(nsIURI*), nsCOMPtr<nsIURI>)::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIJARURIMutator::*)(nsTSubstring<char> const&, nsIURI*, char const*), nsTString<char>, nsCOMPtr<nsIURI>, char const*>(nsresult (nsIJARURIMutator::*)(nsTSubstring<char> const&, nsIURI*, char const*), nsTString<char>, nsCOMPtr<nsIURI>, char const*)::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Line | Count | Source | 444 | 5.35k | return [=](nsIURIMutator* aMutator) { | 445 | 5.35k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 5.35k | nsresult rv; | 447 | 5.35k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 5.35k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 5.35k | rv = (target->*aMethod)(aArgs...); | 450 | 5.35k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 5.35k | return NS_OK; | 452 | 5.35k | }; |
std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTAutoStringN<char, 64ul>, char const*, decltype(nullptr), decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTAutoStringN<char, 64ul>, char const*, decltype(nullptr), decltype(nullptr))::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Line | Count | Source | 444 | 2.22k | return [=](nsIURIMutator* aMutator) { | 445 | 2.22k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 2.22k | nsresult rv; | 447 | 2.22k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 2.22k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 2.22k | rv = (target->*aMethod)(aArgs...); | 450 | 2.22k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 2.22k | return NS_OK; | 452 | 2.22k | }; |
std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, char const*, nsCOMPtr<nsIURL>, decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, char const*, nsCOMPtr<nsIURL>, decltype(nullptr))::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Line | Count | Source | 444 | 90 | return [=](nsIURIMutator* aMutator) { | 445 | 90 | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 90 | nsresult rv; | 447 | 90 | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 90 | NS_ENSURE_SUCCESS(rv, rv); | 449 | 90 | rv = (target->*aMethod)(aArgs...); | 450 | 90 | NS_ENSURE_SUCCESS(rv, rv); | 451 | 90 | return NS_OK; | 452 | 90 | }; |
Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIURLMutator::*)(nsTSubstring<char> const&, nsIURIMutator**), nsTString<char>, decltype(nullptr)>(nsresult (nsIURLMutator::*)(nsTSubstring<char> const&, nsIURIMutator**), nsTString<char>, decltype(nullptr))::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIURLMutator::*)(nsTSubstring<char> const&, nsIURIMutator**), nsTAutoStringN<char, 64ul>, decltype(nullptr)>(nsresult (nsIURLMutator::*)(nsTSubstring<char> const&, nsIURIMutator**), nsTAutoStringN<char, 64ul>, decltype(nullptr))::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIJSURIMutator::*)(nsIURI*), nsCOMPtr<nsIURI> >(nsresult (nsIJSURIMutator::*)(nsIURI*), nsCOMPtr<nsIURI>)::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const Line | Count | Source | 444 | 1.79k | return [=](nsIURIMutator* aMutator) { | 445 | 1.79k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 1.79k | nsresult rv; | 447 | 1.79k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 1.79k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 1.79k | rv = (target->*aMethod)(aArgs...); | 450 | 1.79k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 1.79k | return NS_OK; | 452 | 1.79k | }; |
Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIFileURLMutator::*)(nsIFile*), nsCOMPtr<nsIFile> >(nsresult (nsIFileURLMutator::*)(nsIFile*), nsCOMPtr<nsIFile>)::{lambda(nsIURIMutator*)#1}::operator()(nsIURIMutator*) const |
453 | 1.13M | } std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, char const*, nsCOMPtr<nsIURI>, decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, char const*, nsCOMPtr<nsIURI>, decltype(nullptr)) Line | Count | Source | 442 | 1.11M | { | 443 | 1.11M | // Capture arguments by value, otherwise we crash. | 444 | 1.11M | return [=](nsIURIMutator* aMutator) { | 445 | 1.11M | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 1.11M | nsresult rv; | 447 | 1.11M | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 1.11M | NS_ENSURE_SUCCESS(rv, rv); | 449 | 1.11M | rv = (target->*aMethod)(aArgs...); | 450 | 1.11M | NS_ENSURE_SUCCESS(rv, rv); | 451 | 1.11M | return NS_OK; | 452 | 1.11M | }; | 453 | 1.11M | } |
Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(int, nsIURIMutator**), int, decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(int, nsIURIMutator**), int, decltype(nullptr)) Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, decltype(nullptr), decltype(nullptr), decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, decltype(nullptr), decltype(nullptr), decltype(nullptr)) Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsINestedAboutURIMutator::*)(nsIURI*, nsIURI*), nsCOMPtr<nsIURI>, nsCOMPtr<nsIURI> >(nsresult (nsINestedAboutURIMutator::*)(nsIURI*, nsIURI*), nsCOMPtr<nsIURI>, nsCOMPtr<nsIURI>) std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIFileURLMutator::*)()>(nsresult (nsIFileURLMutator::*)()) Line | Count | Source | 442 | 4.68k | { | 443 | 4.68k | // Capture arguments by value, otherwise we crash. | 444 | 4.68k | return [=](nsIURIMutator* aMutator) { | 445 | 4.68k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 4.68k | nsresult rv; | 447 | 4.68k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 4.68k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 4.68k | rv = (target->*aMethod)(aArgs...); | 450 | 4.68k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 4.68k | return NS_OK; | 452 | 4.68k | }; | 453 | 4.68k | } |
std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTAutoStringN<char, 64ul>, char const*, nsCOMPtr<nsIURI>, decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTAutoStringN<char, 64ul>, char const*, nsCOMPtr<nsIURI>, decltype(nullptr)) Line | Count | Source | 442 | 7.26k | { | 443 | 7.26k | // Capture arguments by value, otherwise we crash. | 444 | 7.26k | return [=](nsIURIMutator* aMutator) { | 445 | 7.26k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 7.26k | nsresult rv; | 447 | 7.26k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 7.26k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 7.26k | rv = (target->*aMethod)(aArgs...); | 450 | 7.26k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 7.26k | return NS_OK; | 452 | 7.26k | }; | 453 | 7.26k | } |
Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIFileURLMutator::*)(nsIFile*), RefPtr<nsIFile> >(nsresult (nsIFileURLMutator::*)(nsIFile*), RefPtr<nsIFile>) Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsINestedURIMutator::*)(nsIURI*), nsCOMPtr<nsIURI> >(nsresult (nsINestedURIMutator::*)(nsIURI*), nsCOMPtr<nsIURI>) std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIJARURIMutator::*)(nsTSubstring<char> const&, nsIURI*, char const*), nsTString<char>, nsCOMPtr<nsIURI>, char const*>(nsresult (nsIJARURIMutator::*)(nsTSubstring<char> const&, nsIURI*, char const*), nsTString<char>, nsCOMPtr<nsIURI>, char const*) Line | Count | Source | 442 | 5.35k | { | 443 | 5.35k | // Capture arguments by value, otherwise we crash. | 444 | 5.35k | return [=](nsIURIMutator* aMutator) { | 445 | 5.35k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 5.35k | nsresult rv; | 447 | 5.35k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 5.35k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 5.35k | rv = (target->*aMethod)(aArgs...); | 450 | 5.35k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 5.35k | return NS_OK; | 452 | 5.35k | }; | 453 | 5.35k | } |
std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTAutoStringN<char, 64ul>, char const*, decltype(nullptr), decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTAutoStringN<char, 64ul>, char const*, decltype(nullptr), decltype(nullptr)) Line | Count | Source | 442 | 2.22k | { | 443 | 2.22k | // Capture arguments by value, otherwise we crash. | 444 | 2.22k | return [=](nsIURIMutator* aMutator) { | 445 | 2.22k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 2.22k | nsresult rv; | 447 | 2.22k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 2.22k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 2.22k | rv = (target->*aMethod)(aArgs...); | 450 | 2.22k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 2.22k | return NS_OK; | 452 | 2.22k | }; | 453 | 2.22k | } |
std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, char const*, nsCOMPtr<nsIURL>, decltype(nullptr)>(nsresult (nsIStandardURLMutator::*)(unsigned int, int, nsTSubstring<char> const&, char const*, nsIURI*, nsIURIMutator**), nsIStandardURL::{unnamed type#1}, int, nsTString<char>, char const*, nsCOMPtr<nsIURL>, decltype(nullptr)) Line | Count | Source | 442 | 90 | { | 443 | 90 | // Capture arguments by value, otherwise we crash. | 444 | 90 | return [=](nsIURIMutator* aMutator) { | 445 | 90 | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 90 | nsresult rv; | 447 | 90 | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 90 | NS_ENSURE_SUCCESS(rv, rv); | 449 | 90 | rv = (target->*aMethod)(aArgs...); | 450 | 90 | NS_ENSURE_SUCCESS(rv, rv); | 451 | 90 | return NS_OK; | 452 | 90 | }; | 453 | 90 | } |
Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIURLMutator::*)(nsTSubstring<char> const&, nsIURIMutator**), nsTString<char>, decltype(nullptr)>(nsresult (nsIURLMutator::*)(nsTSubstring<char> const&, nsIURIMutator**), nsTString<char>, decltype(nullptr)) Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIURLMutator::*)(nsTSubstring<char> const&, nsIURIMutator**), nsTAutoStringN<char, 64ul>, decltype(nullptr)>(nsresult (nsIURLMutator::*)(nsTSubstring<char> const&, nsIURIMutator**), nsTAutoStringN<char, 64ul>, decltype(nullptr)) std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIJSURIMutator::*)(nsIURI*), nsCOMPtr<nsIURI> >(nsresult (nsIJSURIMutator::*)(nsIURI*), nsCOMPtr<nsIURI>) Line | Count | Source | 442 | 1.79k | { | 443 | 1.79k | // Capture arguments by value, otherwise we crash. | 444 | 1.79k | return [=](nsIURIMutator* aMutator) { | 445 | 1.79k | typedef typename nsMethodTypeTraits<Method>::class_type Interface; | 446 | 1.79k | nsresult rv; | 447 | 1.79k | nsCOMPtr<Interface> target = do_QueryInterface(aMutator, &rv); | 448 | 1.79k | NS_ENSURE_SUCCESS(rv, rv); | 449 | 1.79k | rv = (target->*aMethod)(aArgs...); | 450 | 1.79k | NS_ENSURE_SUCCESS(rv, rv); | 451 | 1.79k | return NS_OK; | 452 | 1.79k | }; | 453 | 1.79k | } |
Unexecuted instantiation: std::__1::function<nsresult (nsIURIMutator*)> const NS_MutatorMethod<nsresult (nsIFileURLMutator::*)(nsIFile*), nsCOMPtr<nsIFile> >(nsresult (nsIFileURLMutator::*)(nsIFile*), nsCOMPtr<nsIFile>) |
454 | | // This class provides a useful helper that allows chaining of setter operations |
455 | | class MOZ_STACK_CLASS NS_MutateURI |
456 | | { |
457 | | public: |
458 | | explicit NS_MutateURI(nsIURI* aURI); |
459 | | explicit NS_MutateURI(const char * aContractID); |
460 | | explicit NS_MutateURI(nsIURIMutator* m) |
461 | 1.13M | { |
462 | 1.13M | mStatus = m ? NS_OK : NS_ERROR_NULL_POINTER; |
463 | 1.13M | mMutator = m; |
464 | 1.13M | NS_ENSURE_SUCCESS_VOID(mStatus); |
465 | 1.13M | } |
466 | | NS_MutateURI& SetSpec(const nsACString& aSpec) |
467 | 297k | { |
468 | 297k | if (NS_FAILED(mStatus)) { |
469 | 0 | return *this; |
470 | 0 | } |
471 | 297k | mStatus = mMutator->SetSpec(aSpec, nullptr); |
472 | 297k | NS_ENSURE_SUCCESS(mStatus, *this); |
473 | 297k | return *this; |
474 | 297k | } |
475 | | NS_MutateURI& SetScheme(const nsACString& aScheme) |
476 | 0 | { |
477 | 0 | if (NS_FAILED(mStatus)) { |
478 | 0 | return *this; |
479 | 0 | } |
480 | 0 | mStatus = mMutator->SetScheme(aScheme, nullptr); |
481 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
482 | 0 | return *this; |
483 | 0 | } |
484 | | NS_MutateURI& SetUserPass(const nsACString& aUserPass) |
485 | 0 | { |
486 | 0 | if (NS_FAILED(mStatus)) { |
487 | 0 | return *this; |
488 | 0 | } |
489 | 0 | mStatus = mMutator->SetUserPass(aUserPass, nullptr); |
490 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
491 | 0 | return *this; |
492 | 0 | } |
493 | | NS_MutateURI& SetUsername(const nsACString& aUsername) |
494 | 0 | { |
495 | 0 | if (NS_FAILED(mStatus)) { |
496 | 0 | return *this; |
497 | 0 | } |
498 | 0 | mStatus = mMutator->SetUsername(aUsername, nullptr); |
499 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
500 | 0 | return *this; |
501 | 0 | } |
502 | | NS_MutateURI& SetPassword(const nsACString& aPassword) |
503 | 0 | { |
504 | 0 | if (NS_FAILED(mStatus)) { |
505 | 0 | return *this; |
506 | 0 | } |
507 | 0 | mStatus = mMutator->SetPassword(aPassword, nullptr); |
508 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
509 | 0 | return *this; |
510 | 0 | } |
511 | | NS_MutateURI& SetHostPort(const nsACString& aHostPort) |
512 | 0 | { |
513 | 0 | if (NS_FAILED(mStatus)) { |
514 | 0 | return *this; |
515 | 0 | } |
516 | 0 | mStatus = mMutator->SetHostPort(aHostPort, nullptr); |
517 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
518 | 0 | return *this; |
519 | 0 | } |
520 | | NS_MutateURI& SetHost(const nsACString& aHost) |
521 | 0 | { |
522 | 0 | if (NS_FAILED(mStatus)) { |
523 | 0 | return *this; |
524 | 0 | } |
525 | 0 | mStatus = mMutator->SetHost(aHost, nullptr); |
526 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
527 | 0 | return *this; |
528 | 0 | } |
529 | | NS_MutateURI& SetPort(int32_t aPort) |
530 | 0 | { |
531 | 0 | if (NS_FAILED(mStatus)) { |
532 | 0 | return *this; |
533 | 0 | } |
534 | 0 | mStatus = mMutator->SetPort(aPort, nullptr); |
535 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
536 | 0 | return *this; |
537 | 0 | } |
538 | | NS_MutateURI& SetPathQueryRef(const nsACString& aPathQueryRef) |
539 | 1.59k | { |
540 | 1.59k | if (NS_FAILED(mStatus)) { |
541 | 0 | return *this; |
542 | 0 | } |
543 | 1.59k | mStatus = mMutator->SetPathQueryRef(aPathQueryRef, nullptr); |
544 | 1.59k | NS_ENSURE_SUCCESS(mStatus, *this); |
545 | 1.59k | return *this; |
546 | 1.59k | } |
547 | | NS_MutateURI& SetRef(const nsACString& aRef) |
548 | 2.32k | { |
549 | 2.32k | if (NS_FAILED(mStatus)) { |
550 | 0 | return *this; |
551 | 0 | } |
552 | 2.32k | mStatus = mMutator->SetRef(aRef, nullptr); |
553 | 2.32k | NS_ENSURE_SUCCESS(mStatus, *this); |
554 | 2.32k | return *this; |
555 | 2.32k | } |
556 | | NS_MutateURI& SetFilePath(const nsACString& aFilePath) |
557 | 0 | { |
558 | 0 | if (NS_FAILED(mStatus)) { |
559 | 0 | return *this; |
560 | 0 | } |
561 | 0 | mStatus = mMutator->SetFilePath(aFilePath, nullptr); |
562 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
563 | 0 | return *this; |
564 | 0 | } |
565 | | NS_MutateURI& SetQuery(const nsACString& aQuery) |
566 | 0 | { |
567 | 0 | if (NS_FAILED(mStatus)) { |
568 | 0 | return *this; |
569 | 0 | } |
570 | 0 | mStatus = mMutator->SetQuery(aQuery, nullptr); |
571 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
572 | 0 | return *this; |
573 | 0 | } |
574 | | NS_MutateURI& SetQueryWithEncoding(const nsACString& query, const mozilla::Encoding *encoding) |
575 | 0 | { |
576 | 0 | if (NS_FAILED(mStatus)) { |
577 | 0 | return *this; |
578 | 0 | } |
579 | 0 | mStatus = mMutator->SetQueryWithEncoding(query, encoding, nullptr); |
580 | 0 | NS_ENSURE_SUCCESS(mStatus, *this); |
581 | 0 | return *this; |
582 | 0 | } |
583 | | /** |
584 | | * This method allows consumers to call the methods declared in other |
585 | | * interfaces implemented by the mutator object. |
586 | | * |
587 | | * Example: |
588 | | * nsCOMPtr<nsIURI> uri; |
589 | | * nsresult rv = NS_MutateURI(new URIClass::Mutator()) |
590 | | * .SetSpec(aSpec) |
591 | | * .Apply(NS_MutatorMethod(&SomeInterface::Method, arg1, arg2)) |
592 | | * .Finalize(uri); |
593 | | * |
594 | | * If mMutator does not implement SomeInterface, do_QueryInterface will fail |
595 | | * and the method will not be called. |
596 | | * If aMethod does not exist, or if there is a mismatch between argument |
597 | | * types, or the number of arguments, then there will be a compile error. |
598 | | */ |
599 | | NS_MutateURI& Apply(const std::function<nsresult(nsIURIMutator*)>& aFunction) |
600 | 1.13M | { |
601 | 1.13M | if (NS_FAILED(mStatus)) { |
602 | 0 | return *this; |
603 | 0 | } |
604 | 1.13M | mStatus = aFunction(mMutator); |
605 | 1.13M | NS_ENSURE_SUCCESS(mStatus, *this); |
606 | 1.13M | return *this; |
607 | 1.13M | } |
608 | | template <class C> |
609 | | MOZ_MUST_USE nsresult Finalize(nsCOMPtr<C>& aURI) |
610 | 0 | { |
611 | 0 | NS_ENSURE_SUCCESS(mStatus, mStatus); |
612 | 0 | nsCOMPtr<nsIURI> uri; |
613 | 0 | mStatus = mMutator->Finalize(getter_AddRefs(uri)); |
614 | 0 | NS_ENSURE_SUCCESS(mStatus, mStatus); |
615 | 0 | aURI = do_QueryInterface(uri, &mStatus); |
616 | 0 | NS_ENSURE_SUCCESS(mStatus, mStatus); |
617 | 0 | mStatus = NS_ERROR_NOT_AVAILABLE; // Second call to Finalize should fail. |
618 | 0 | return NS_OK; |
619 | 0 | } Unexecuted instantiation: nsresult NS_MutateURI::Finalize<nsIURL>(nsCOMPtr<nsIURL>&) Unexecuted instantiation: nsresult NS_MutateURI::Finalize<nsIFileURL>(nsCOMPtr<nsIFileURL>&) |
620 | | // Overload for nsIURI to avoid query interface. |
621 | | MOZ_MUST_USE nsresult Finalize(nsCOMPtr<nsIURI>& aURI) |
622 | 39.6k | { |
623 | 39.6k | NS_ENSURE_SUCCESS(mStatus, mStatus); |
624 | 39.6k | mStatus = mMutator->Finalize(getter_AddRefs(aURI)); |
625 | 38.5k | NS_ENSURE_SUCCESS(mStatus, mStatus); |
626 | 38.5k | mStatus = NS_ERROR_NOT_AVAILABLE; // Second call to Finalize should fail. |
627 | 38.5k | return NS_OK; |
628 | 38.5k | } |
629 | | template <class C> |
630 | | MOZ_MUST_USE nsresult Finalize(C** aURI) |
631 | 2.22k | { |
632 | 2.22k | NS_ENSURE_SUCCESS(mStatus, mStatus); |
633 | 2.22k | nsCOMPtr<nsIURI> uri; |
634 | 2.22k | mStatus = mMutator->Finalize(getter_AddRefs(uri)); |
635 | 2.22k | NS_ENSURE_SUCCESS(mStatus, mStatus); |
636 | 2.22k | nsCOMPtr<C> result = do_QueryInterface(uri, &mStatus); |
637 | 2.22k | NS_ENSURE_SUCCESS(mStatus, mStatus); |
638 | 2.22k | result.forget(aURI); |
639 | 2.22k | mStatus = NS_ERROR_NOT_AVAILABLE; // Second call to Finalize should fail. |
640 | 2.22k | return NS_OK; |
641 | 2.22k | } nsresult NS_MutateURI::Finalize<nsIURL>(nsIURL**) Line | Count | Source | 631 | 2.22k | { | 632 | 2.22k | NS_ENSURE_SUCCESS(mStatus, mStatus); | 633 | 2.22k | nsCOMPtr<nsIURI> uri; | 634 | 2.22k | mStatus = mMutator->Finalize(getter_AddRefs(uri)); | 635 | 2.22k | NS_ENSURE_SUCCESS(mStatus, mStatus); | 636 | 2.22k | nsCOMPtr<C> result = do_QueryInterface(uri, &mStatus); | 637 | 2.22k | NS_ENSURE_SUCCESS(mStatus, mStatus); | 638 | 2.22k | result.forget(aURI); | 639 | 2.22k | mStatus = NS_ERROR_NOT_AVAILABLE; // Second call to Finalize should fail. | 640 | 2.22k | return NS_OK; | 641 | 2.22k | } |
Unexecuted instantiation: nsresult NS_MutateURI::Finalize<nsIURI>(nsIURI**) |
642 | | MOZ_MUST_USE nsresult Finalize(nsIURI** aURI) |
643 | 1.39M | { |
644 | 1.39M | NS_ENSURE_SUCCESS(mStatus, mStatus); |
645 | 1.39M | mStatus = mMutator->Finalize(aURI); |
646 | 1.35M | NS_ENSURE_SUCCESS(mStatus, mStatus); |
647 | 1.35M | mStatus = NS_ERROR_NOT_AVAILABLE; // Second call to Finalize should fail. |
648 | 1.35M | return NS_OK; |
649 | 1.35M | } |
650 | 0 | nsresult GetStatus() { return mStatus; } |
651 | | private: |
652 | | nsresult mStatus; |
653 | | nsCOMPtr<nsIURIMutator> mMutator; |
654 | | }; |
655 | | |
656 | | #endif /* __gen_nsIURIMutator_h__ */ |