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
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsISupports.idl" |
michael@0 | 8 | |
michael@0 | 9 | interface nsIEventTarget; |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * nsIThreadRetargetableRequest |
michael@0 | 13 | * |
michael@0 | 14 | * Should be implemented by requests that support retargeting delivery of |
michael@0 | 15 | * data off the main thread. |
michael@0 | 16 | */ |
michael@0 | 17 | [uuid(27b84c48-5a73-4ba4-a8a4-8b5e649a145e)] |
michael@0 | 18 | interface nsIThreadRetargetableRequest : nsISupports |
michael@0 | 19 | { |
michael@0 | 20 | /** |
michael@0 | 21 | * Called to retarget delivery of OnDataAvailable to another thread. Should |
michael@0 | 22 | * only be called before AsyncOpen for nsIWebsocketChannels, or during |
michael@0 | 23 | * OnStartRequest for nsIHttpChannels. |
michael@0 | 24 | * Note: For nsIHttpChannels, OnStartRequest and OnStopRequest will still be |
michael@0 | 25 | * delivered on the main thread. |
michael@0 | 26 | * |
michael@0 | 27 | * @param aNewTarget New event target, e.g. thread or threadpool. |
michael@0 | 28 | * |
michael@0 | 29 | * Note: no return value is given. If the retargeting cannot be handled, |
michael@0 | 30 | * normal delivery to the main thread will continue. As such, listeners |
michael@0 | 31 | * should be ready to deal with OnDataAvailable on either the main thread or |
michael@0 | 32 | * the new target thread. |
michael@0 | 33 | */ |
michael@0 | 34 | void retargetDeliveryTo(in nsIEventTarget aNewTarget); |
michael@0 | 35 | }; |
michael@0 | 36 | |
michael@0 | 37 |