netwerk/base/src/ADivertableParentChannel.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/src/ADivertableParentChannel.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     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 +#ifndef _adivertablechannelparent_h_
    1.11 +#define _adivertablechannelparent_h_
    1.12 +
    1.13 +#include "nsISupports.h"
    1.14 +
    1.15 +class nsIStreamListener;
    1.16 +
    1.17 +namespace mozilla {
    1.18 +namespace net {
    1.19 +
    1.20 +// To be implemented by a channel's parent actors, e.g. HttpChannelParent
    1.21 +// and FTPChannelParent. Used by ChannelDiverterParent to divert
    1.22 +// nsIStreamListener callbacks from the child process to a new
    1.23 +// listener in the parent process.
    1.24 +class ADivertableParentChannel : public nsISupports
    1.25 +{
    1.26 +public:
    1.27 +  // Called by ChannelDiverterParent::DivertTo(nsIStreamListener*).
    1.28 +  // The listener should now be used to received nsIStreamListener callbacks,
    1.29 +  // i.e. OnStartRequest, OnDataAvailable and OnStopRequest, as if it had been
    1.30 +  // passed to AsyncOpen for the channel. A reference to the listener will be
    1.31 +  // added and kept until OnStopRequest has completed.
    1.32 +  virtual void DivertTo(nsIStreamListener *aListener) = 0;
    1.33 +
    1.34 +  // Called to suspend parent channel in ChannelDiverterParent constructor.
    1.35 +  virtual nsresult SuspendForDiversion() = 0;
    1.36 +};
    1.37 +
    1.38 +} // namespace net
    1.39 +} // namespace mozilla
    1.40 +
    1.41 +#endif

mercurial