nsIBackgroundChannelRegistrar.idl (2424B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #include "nsISupports.idl" 8 9 %{ C++ 10 namespace mozilla { 11 namespace net { 12 class HttpBackgroundChannelParent; 13 class HttpChannelParent; 14 } 15 } 16 %} 17 18 [ptr] native HttpChannelParent(mozilla::net::HttpChannelParent); 19 [ptr] native HttpBackgroundChannelParent(mozilla::net::HttpBackgroundChannelParent); 20 21 /* 22 * Registrar for pairing HttpChannelParent and HttpBackgroundChannelParent via 23 * channel Id. HttpChannelParent::OnBackgroundParentReady and 24 * HttpBackgroundChannelParent::LinkToChannel will be invoked to notify the 25 * existence of associated channel object. 26 */ 27 [uuid(8acaa9b1-f0c4-4ade-baeb-39b0d4b96e5b)] 28 interface nsIBackgroundChannelRegistrar : nsISupports 29 { 30 /* 31 * Link the provided channel parent actor with the given channel Id. 32 * callbacks will be invoked immediately when the HttpBackgroundChannelParent 33 * associated with the same channel Id is found. Store the HttpChannelParent 34 * until a matched linkBackgroundChannel is invoked. 35 * 36 * @param aKey the channel Id 37 * @param aChannel the channel parent actor to be paired 38 */ 39 [noscript,notxpcom,nostdcall] void linkHttpChannel(in uint64_t aKey, 40 in HttpChannelParent aChannel); 41 42 /* 43 * Link the provided background channel with the given channel Id. 44 * callbacks will be invoked immediately when the HttpChannelParent associated 45 * with the same channel Id is found. Store the HttpBackgroundChannelParent 46 * until a matched linkHttpChannel is invoked. 47 * 48 * @param aKey the channel Id 49 * @param aBgChannel the background channel to be paired 50 */ 51 [noscript,notxpcom,nostdcall] void linkBackgroundChannel(in uint64_t aKey, 52 in HttpBackgroundChannelParent aBgChannel); 53 54 /* 55 * Delete previous stored HttpChannelParent or HttpBackgroundChannelParent 56 * if no need to wait for the paired channel object, e.g. background channel 57 * is destroyed before pairing is completed. 58 * 59 * @param aKey the channel Id 60 */ 61 [noscript,notxpcom,nostdcall] void deleteChannel(in uint64_t aKey); 62 63 };