netwerk/base/public/nsIRedirectChannelRegistrar.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #include "nsISupports.idl"
     7 interface nsIChannel;
     8 interface nsIParentChannel;
    10 /**
    11  * Used on the chrome process as a service to join channel implementation
    12  * and parent IPC protocol side under a unique id.  Provides this way a generic
    13  * communication while redirecting to various protocols.
    14  *
    15  * See also nsIChildChannel and nsIParentChannel.
    16  */
    18 [scriptable, uuid (efa36ea2-5b07-46fc-9534-a5acb8b77b72)]
    19 interface nsIRedirectChannelRegistrar : nsISupports
    20 {
    21   /**
    22    * Register the redirect target channel and obtain a unique ID for that
    23    * channel.
    24    *
    25    * Primarily used in HttpChannelParentListener::AsyncOnChannelRedirect to get
    26    * a channel id sent to the HttpChannelChild being redirected.
    27    */
    28   uint32_t registerChannel(in nsIChannel channel);
    30   /**
    31    * First, search for the channel registered under the id.  If found return
    32    * it.  Then, register under the same id the parent side of IPC protocol
    33    * to let it be later grabbed back by the originator of the redirect and
    34    * notifications from the real channel could be forwarded to this parent
    35    * channel.
    36    *
    37    * Primarily used in parent side of an IPC protocol implementation
    38    * in reaction to nsIChildChannel.connectParent(id) called from the child
    39    * process.
    40    */
    41   nsIChannel linkChannels(in uint32_t id, in nsIParentChannel channel);
    43   /**
    44    * Returns back the channel previously registered under the ID with
    45    * registerChannel method.
    46    *
    47    * Primarilly used in chrome IPC side of protocols when attaching a redirect
    48    * target channel to an existing 'real' channel implementation.
    49    */
    50   nsIChannel getRegisteredChannel(in uint32_t id);
    52   /**
    53    * Returns the stream listener that shall be attached to the redirect target
    54    * channel, all notification from the redirect target channel will be
    55    * forwarded to this stream listener.
    56    *
    57    * Primarilly used in HttpChannelParentListener::OnRedirectResult callback
    58    * to grab the created parent side of the channel and forward notifications
    59    * to it.
    60    */
    61   nsIParentChannel getParentChannel(in uint32_t id);
    63   /**
    64    * To not force all channel implementations to support weak reference
    65    * consumers of this service must ensure release of registered channels them
    66    * self.  This releases both the real and parent channel registered under
    67    * the id.
    68    *
    69    * Primarilly used in HttpChannelParentListener::OnRedirectResult callback.
    70    */
    71   void deregisterChannels(in uint32_t id);
    72 };

mercurial