michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 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: #include "nsISupports.idl" michael@0: michael@0: interface nsIEventTarget; michael@0: michael@0: /** michael@0: * nsIThreadRetargetableRequest michael@0: * michael@0: * Should be implemented by requests that support retargeting delivery of michael@0: * data off the main thread. michael@0: */ michael@0: [uuid(27b84c48-5a73-4ba4-a8a4-8b5e649a145e)] michael@0: interface nsIThreadRetargetableRequest : nsISupports michael@0: { michael@0: /** michael@0: * Called to retarget delivery of OnDataAvailable to another thread. Should michael@0: * only be called before AsyncOpen for nsIWebsocketChannels, or during michael@0: * OnStartRequest for nsIHttpChannels. michael@0: * Note: For nsIHttpChannels, OnStartRequest and OnStopRequest will still be michael@0: * delivered on the main thread. michael@0: * michael@0: * @param aNewTarget New event target, e.g. thread or threadpool. michael@0: * michael@0: * Note: no return value is given. If the retargeting cannot be handled, michael@0: * normal delivery to the main thread will continue. As such, listeners michael@0: * should be ready to deal with OnDataAvailable on either the main thread or michael@0: * the new target thread. michael@0: */ michael@0: void retargetDeliveryTo(in nsIEventTarget aNewTarget); michael@0: }; michael@0: michael@0: