1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/public/nsIDivertableChannel.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,60 @@ 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 +%{C++ 1.13 +namespace mozilla { 1.14 +namespace net { 1.15 +class ChannelDiverterChild; 1.16 +} 1.17 +} 1.18 +%} 1.19 + 1.20 +[ptr] native ChannelDiverterChild(mozilla::net::ChannelDiverterChild); 1.21 + 1.22 +interface nsIStreamListener; 1.23 + 1.24 +/** 1.25 + * A channel implementing this interface allows diverting from an 1.26 + * nsIStreamListener in the child process to one in the parent. 1.27 + */ 1.28 +[uuid(4430e0d0-ff70-45f5-99dc-b5fd06943fc1)] 1.29 +interface nsIDivertableChannel : nsISupports 1.30 +{ 1.31 + /** 1.32 + * CHILD ONLY. 1.33 + * Called by Necko client in child process during OnStartRequest to divert 1.34 + * nsIStreamListener and nsIRequest callbacks to the parent process. 1.35 + * 1.36 + * The process should look like the following: 1.37 + * 1.38 + * 1) divertToParent is called in the child process. It can only be called 1.39 + * during OnStartRequest(). 1.40 + * 1.41 + * 2) The ChannelDiverterChild that is returned is an IPDL object. It should 1.42 + * be passed via some other IPDL method of the client's choosing to the 1.43 + * parent. On the parent the ChannelDiverterParent's divertTo() function 1.44 + * should be called with an nsIStreamListener that will then receive the 1.45 + * OnStartRequest/OnDataAvailable/OnStopRequest for the channel. The 1.46 + * ChannelDiverterParent can then be deleted (which will also destroy the 1.47 + * ChannelDiverterChild in the child). 1.48 + * 1.49 + * After divertToParent() has been called, NO further function calls 1.50 + * should be made on the channel. It is a dead object for all purposes. 1.51 + * The reference that the channel holds to the listener in the child is 1.52 + * released is once OnStartRequest completes, and no other 1.53 + * nsIStreamListener calls (OnDataAvailable, OnStopRequest) will be made 1.54 + * to it. 1.55 + * 1.56 + * @return ChannelDiverterChild IPDL actor to be passed to parent process by 1.57 + * client IPDL message, e.g. PClient.DivertUsing(PDiverterChild). 1.58 + * 1.59 + * @throws exception if the channel was canceled early. Throws status code of 1.60 + * canceled channel. 1.61 + */ 1.62 + ChannelDiverterChild divertToParent(); 1.63 +};