1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/src/nsTransportUtils.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,29 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef nsTransportUtils_h__ 1.9 +#define nsTransportUtils_h__ 1.10 + 1.11 +#include "nsITransport.h" 1.12 + 1.13 +/** 1.14 + * This function returns a proxy object for a transport event sink instance. 1.15 + * The transport event sink will be called on the thread indicated by the 1.16 + * given event target. Like events are automatically coalesced. This means 1.17 + * that for example if the status value is the same from event to event, and 1.18 + * the previous event has not yet been delivered, then only one event will 1.19 + * be delivered. The progress reported will be that from the second event. 1.20 + * If aCoalesceAllEvents is true, then any undelivered event will be replaced 1.21 + * with the next event if it arrives early enough. This option should be used 1.22 + * cautiously since it can cause states to be effectively skipped. Coalescing 1.23 + * events can help prevent a backlog of unprocessed transport events in the 1.24 + * case that the target thread is overworked. 1.25 + */ 1.26 +NS_HIDDEN_(nsresult) 1.27 +net_NewTransportEventSinkProxy(nsITransportEventSink **aResult, 1.28 + nsITransportEventSink *aSink, 1.29 + nsIEventTarget *aTarget, 1.30 + bool aCoalesceAllEvents = false); 1.31 + 1.32 +#endif // nsTransportUtils_h__