netwerk/protocol/http/HttpChannelParentListener.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set sw=2 ts=8 et tw=80 : */
     4 /* This Source Code Form is subject to the terms of the Mozilla Public
     5  * License, v. 2.0. If a copy of the MPL was not distributed with this
     6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     8 #ifndef mozilla_net_HttpChannelCallbackWrapper_h
     9 #define mozilla_net_HttpChannelCallbackWrapper_h
    11 #include "nsIInterfaceRequestor.h"
    12 #include "nsIChannelEventSink.h"
    13 #include "nsIRedirectResultListener.h"
    15 class nsIParentChannel;
    17 namespace mozilla {
    18 namespace net {
    20 class HttpChannelParent;
    22 class HttpChannelParentListener : public nsIInterfaceRequestor
    23                                  , public nsIChannelEventSink
    24                                  , public nsIRedirectResultListener
    25                                  , public nsIStreamListener
    26 {
    27 public:
    28   NS_DECL_ISUPPORTS
    29   NS_DECL_NSIINTERFACEREQUESTOR
    30   NS_DECL_NSICHANNELEVENTSINK
    31   NS_DECL_NSIREDIRECTRESULTLISTENER
    32   NS_DECL_NSIREQUESTOBSERVER
    33   NS_DECL_NSISTREAMLISTENER
    35   HttpChannelParentListener(HttpChannelParent* aInitialChannel);
    36   virtual ~HttpChannelParentListener();
    38   // For channel diversion from child to parent.
    39   nsresult DivertTo(nsIStreamListener *aListener);
    40   nsresult SuspendForDiversion();
    42 private:
    43   // Private partner function to SuspendForDiversion.
    44   nsresult ResumeForDiversion();
    46   // Can be the original HttpChannelParent that created this object (normal
    47   // case), a different {HTTP|FTP}ChannelParent that we've been redirected to,
    48   // or some other listener that we have been diverted to via
    49   // nsIDivertableChannel.
    50   nsCOMPtr<nsIStreamListener> mNextListener;
    51   uint32_t mRedirectChannelId;
    52   // When set, no OnStart/OnData/OnStop calls should be received.
    53   bool mSuspendedForDiversion;
    54 };
    56 } // namespace net
    57 } // namespace mozilla
    59 #endif // mozilla_net_HttpChannelParent_h

mercurial