netwerk/base/nsStreamListenerTee.h
author Fred Lin <gasolin@mozilla.com>
Mon, 19 Sep 2016 15:03:46 +0800
changeset 355684 8038403f9988bebba634447c8ba729e18f6eed0a
parent 337529 82092aed0171cf6f9073d224c8b766b7bce41c4f
child 469949 17e1f96d453f869f9bb64cc1d889320ca2b4adba
permissions -rw-r--r--
Bug 1295151 - Install add-on should not show as a permission in the control center. r=MattN, a=ritu MozReview-Commit-ID: ChkG0AU743W

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsStreamListenerTee_h__
#define nsStreamListenerTee_h__

#include "nsIStreamListenerTee.h"
#include "nsIThreadRetargetableStreamListener.h"
#include "nsIInputStreamTee.h"
#include "nsIOutputStream.h"
#include "nsCOMPtr.h"
#include "nsIEventTarget.h"

namespace mozilla {
namespace net {

class nsStreamListenerTee : public nsIStreamListenerTee
                          , public nsIThreadRetargetableStreamListener
{
public:
    NS_DECL_THREADSAFE_ISUPPORTS
    NS_DECL_NSIREQUESTOBSERVER
    NS_DECL_NSISTREAMLISTENER
    NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
    NS_DECL_NSISTREAMLISTENERTEE

    nsStreamListenerTee() { }

private:
    virtual ~nsStreamListenerTee() { }

    nsCOMPtr<nsIInputStreamTee>  mInputTee;
    nsCOMPtr<nsIOutputStream>    mSink;
    nsCOMPtr<nsIStreamListener>  mListener;
    nsCOMPtr<nsIRequestObserver> mObserver;
    nsCOMPtr<nsIEventTarget>     mEventTarget;
};

} // namespace net
} // namespace mozilla

#endif