1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/public/nsIThreadRetargetableRequest.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +interface nsIEventTarget; 1.13 + 1.14 +/** 1.15 + * nsIThreadRetargetableRequest 1.16 + * 1.17 + * Should be implemented by requests that support retargeting delivery of 1.18 + * data off the main thread. 1.19 + */ 1.20 +[uuid(27b84c48-5a73-4ba4-a8a4-8b5e649a145e)] 1.21 +interface nsIThreadRetargetableRequest : nsISupports 1.22 +{ 1.23 + /** 1.24 + * Called to retarget delivery of OnDataAvailable to another thread. Should 1.25 + * only be called before AsyncOpen for nsIWebsocketChannels, or during 1.26 + * OnStartRequest for nsIHttpChannels. 1.27 + * Note: For nsIHttpChannels, OnStartRequest and OnStopRequest will still be 1.28 + * delivered on the main thread. 1.29 + * 1.30 + * @param aNewTarget New event target, e.g. thread or threadpool. 1.31 + * 1.32 + * Note: no return value is given. If the retargeting cannot be handled, 1.33 + * normal delivery to the main thread will continue. As such, listeners 1.34 + * should be ready to deal with OnDataAvailable on either the main thread or 1.35 + * the new target thread. 1.36 + */ 1.37 + void retargetDeliveryTo(in nsIEventTarget aNewTarget); 1.38 +}; 1.39 + 1.40 +