netwerk/base/public/nsIDivertableChannel.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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/. */
     7 #include "nsISupports.idl"
     9 %{C++
    10 namespace mozilla {
    11 namespace net {
    12 class ChannelDiverterChild;
    13 }
    14 }
    15 %}
    17 [ptr] native ChannelDiverterChild(mozilla::net::ChannelDiverterChild);
    19 interface nsIStreamListener;
    21 /**
    22  * A channel implementing this interface allows diverting from an
    23  * nsIStreamListener in the child process to one in the parent.
    24  */
    25 [uuid(4430e0d0-ff70-45f5-99dc-b5fd06943fc1)]
    26 interface nsIDivertableChannel : nsISupports
    27 {
    28   /**
    29    * CHILD ONLY.
    30    * Called by Necko client in child process during OnStartRequest to divert
    31    * nsIStreamListener and nsIRequest callbacks to the parent process.
    32    *
    33    * The process should look like the following:
    34    *
    35    * 1) divertToParent is called in the child process.  It can only be called
    36    *    during OnStartRequest().
    37    *
    38    * 2) The ChannelDiverterChild that is returned is an IPDL object. It should
    39    *    be passed via some other IPDL method of the client's choosing to the
    40    *    parent.  On the parent the ChannelDiverterParent's divertTo() function
    41    *    should be called with an nsIStreamListener that will then receive the
    42    *    OnStartRequest/OnDataAvailable/OnStopRequest for the channel.  The
    43    *    ChannelDiverterParent can then be deleted (which will also destroy the
    44    *    ChannelDiverterChild in the child).
    45    *
    46    *    After divertToParent() has been called, NO further function calls
    47    *    should be made on the channel.  It is a dead object for all purposes.
    48    *    The reference that the channel holds to the listener in the child is
    49    *    released is once OnStartRequest completes, and no other
    50    *    nsIStreamListener calls (OnDataAvailable, OnStopRequest) will be made
    51    *    to it.
    52    *
    53    * @return ChannelDiverterChild IPDL actor to be passed to parent process by
    54    *         client IPDL message, e.g. PClient.DivertUsing(PDiverterChild).
    55    *
    56    * @throws exception if the channel was canceled early. Throws status code of
    57    *         canceled channel.
    58    */
    59   ChannelDiverterChild divertToParent();
    60 };

mercurial