1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/public/nsIRedirectChannelRegistrar.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,72 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsISupports.idl" 1.9 + 1.10 +interface nsIChannel; 1.11 +interface nsIParentChannel; 1.12 + 1.13 +/** 1.14 + * Used on the chrome process as a service to join channel implementation 1.15 + * and parent IPC protocol side under a unique id. Provides this way a generic 1.16 + * communication while redirecting to various protocols. 1.17 + * 1.18 + * See also nsIChildChannel and nsIParentChannel. 1.19 + */ 1.20 + 1.21 +[scriptable, uuid (efa36ea2-5b07-46fc-9534-a5acb8b77b72)] 1.22 +interface nsIRedirectChannelRegistrar : nsISupports 1.23 +{ 1.24 + /** 1.25 + * Register the redirect target channel and obtain a unique ID for that 1.26 + * channel. 1.27 + * 1.28 + * Primarily used in HttpChannelParentListener::AsyncOnChannelRedirect to get 1.29 + * a channel id sent to the HttpChannelChild being redirected. 1.30 + */ 1.31 + uint32_t registerChannel(in nsIChannel channel); 1.32 + 1.33 + /** 1.34 + * First, search for the channel registered under the id. If found return 1.35 + * it. Then, register under the same id the parent side of IPC protocol 1.36 + * to let it be later grabbed back by the originator of the redirect and 1.37 + * notifications from the real channel could be forwarded to this parent 1.38 + * channel. 1.39 + * 1.40 + * Primarily used in parent side of an IPC protocol implementation 1.41 + * in reaction to nsIChildChannel.connectParent(id) called from the child 1.42 + * process. 1.43 + */ 1.44 + nsIChannel linkChannels(in uint32_t id, in nsIParentChannel channel); 1.45 + 1.46 + /** 1.47 + * Returns back the channel previously registered under the ID with 1.48 + * registerChannel method. 1.49 + * 1.50 + * Primarilly used in chrome IPC side of protocols when attaching a redirect 1.51 + * target channel to an existing 'real' channel implementation. 1.52 + */ 1.53 + nsIChannel getRegisteredChannel(in uint32_t id); 1.54 + 1.55 + /** 1.56 + * Returns the stream listener that shall be attached to the redirect target 1.57 + * channel, all notification from the redirect target channel will be 1.58 + * forwarded to this stream listener. 1.59 + * 1.60 + * Primarilly used in HttpChannelParentListener::OnRedirectResult callback 1.61 + * to grab the created parent side of the channel and forward notifications 1.62 + * to it. 1.63 + */ 1.64 + nsIParentChannel getParentChannel(in uint32_t id); 1.65 + 1.66 + /** 1.67 + * To not force all channel implementations to support weak reference 1.68 + * consumers of this service must ensure release of registered channels them 1.69 + * self. This releases both the real and parent channel registered under 1.70 + * the id. 1.71 + * 1.72 + * Primarilly used in HttpChannelParentListener::OnRedirectResult callback. 1.73 + */ 1.74 + void deregisterChannels(in uint32_t id); 1.75 +};