|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #ifndef nsInterfaceRequestorAgg_h__ |
|
6 #define nsInterfaceRequestorAgg_h__ |
|
7 |
|
8 #include "nsError.h" |
|
9 |
|
10 class nsIEventTarget; |
|
11 class nsIInterfaceRequestor; |
|
12 |
|
13 /** |
|
14 * This function returns an instance of nsIInterfaceRequestor that aggregates |
|
15 * two nsIInterfaceRequestor instances. Its GetInterface method queries |
|
16 * aFirst for the requested interface and will query aSecond only if aFirst |
|
17 * failed to supply the requested interface. Both aFirst and aSecond may |
|
18 * be null, and will be released on the main thread when the aggregator is |
|
19 * destroyed. |
|
20 */ |
|
21 extern nsresult |
|
22 NS_NewInterfaceRequestorAggregation(nsIInterfaceRequestor *aFirst, |
|
23 nsIInterfaceRequestor *aSecond, |
|
24 nsIInterfaceRequestor **aResult); |
|
25 |
|
26 /** |
|
27 * Like the previous method, but aFirst and aSecond will be released on the |
|
28 * provided target thread. |
|
29 */ |
|
30 extern nsresult |
|
31 NS_NewInterfaceRequestorAggregation(nsIInterfaceRequestor *aFirst, |
|
32 nsIInterfaceRequestor *aSecond, |
|
33 nsIEventTarget *aTarget, |
|
34 nsIInterfaceRequestor **aResult); |
|
35 |
|
36 #endif // !defined( nsInterfaceRequestorAgg_h__ ) |