Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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/. */
5 #ifndef nsTransportUtils_h__
6 #define nsTransportUtils_h__
8 #include "nsITransport.h"
10 /**
11 * This function returns a proxy object for a transport event sink instance.
12 * The transport event sink will be called on the thread indicated by the
13 * given event target. Like events are automatically coalesced. This means
14 * that for example if the status value is the same from event to event, and
15 * the previous event has not yet been delivered, then only one event will
16 * be delivered. The progress reported will be that from the second event.
17 * If aCoalesceAllEvents is true, then any undelivered event will be replaced
18 * with the next event if it arrives early enough. This option should be used
19 * cautiously since it can cause states to be effectively skipped. Coalescing
20 * events can help prevent a backlog of unprocessed transport events in the
21 * case that the target thread is overworked.
22 */
23 NS_HIDDEN_(nsresult)
24 net_NewTransportEventSinkProxy(nsITransportEventSink **aResult,
25 nsITransportEventSink *aSink,
26 nsIEventTarget *aTarget,
27 bool aCoalesceAllEvents = false);
29 #endif // nsTransportUtils_h__