michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsTransportUtils_h__ michael@0: #define nsTransportUtils_h__ michael@0: michael@0: #include "nsITransport.h" michael@0: michael@0: /** michael@0: * This function returns a proxy object for a transport event sink instance. michael@0: * The transport event sink will be called on the thread indicated by the michael@0: * given event target. Like events are automatically coalesced. This means michael@0: * that for example if the status value is the same from event to event, and michael@0: * the previous event has not yet been delivered, then only one event will michael@0: * be delivered. The progress reported will be that from the second event. michael@0: * If aCoalesceAllEvents is true, then any undelivered event will be replaced michael@0: * with the next event if it arrives early enough. This option should be used michael@0: * cautiously since it can cause states to be effectively skipped. Coalescing michael@0: * events can help prevent a backlog of unprocessed transport events in the michael@0: * case that the target thread is overworked. michael@0: */ michael@0: NS_HIDDEN_(nsresult) michael@0: net_NewTransportEventSinkProxy(nsITransportEventSink **aResult, michael@0: nsITransportEventSink *aSink, michael@0: nsIEventTarget *aTarget, michael@0: bool aCoalesceAllEvents = false); michael@0: michael@0: #endif // nsTransportUtils_h__