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: /** michael@0: * nsIThreadRetargetableStreamListener michael@0: * michael@0: * To be used by classes which implement nsIStreamListener and whose michael@0: * OnDataAvailable callback may be retargeted for delivery off the main thread. michael@0: */ michael@0: [uuid(fb2304b8-f82f-4433-af68-d874a2ebbdc1)] michael@0: interface nsIThreadRetargetableStreamListener : nsISupports michael@0: { michael@0: /** michael@0: * Checks this listener and any next listeners it may have to verify that michael@0: * they can receive OnDataAvailable off the main thread. It is the michael@0: * responsibility of the implementing class to decide on the criteria to michael@0: * determine if retargeted delivery of these methods is possible, but it must michael@0: * check any and all nsIStreamListener objects that might be called in the michael@0: * listener chain. michael@0: * michael@0: * An exception should be thrown if a listener in the chain does not michael@0: * support retargeted delivery, i.e. if the next listener does not implement michael@0: * nsIThreadRetargetableStreamListener, or a call to its checkListenerChain() michael@0: * fails. michael@0: */ michael@0: void checkListenerChain(); michael@0: }; michael@0: