michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "mozilla/dom/PExternalHelperAppParent.h" michael@0: #include "nsIChannel.h" michael@0: #include "nsIMultiPartChannel.h" michael@0: #include "nsIResumableChannel.h" michael@0: #include "nsIStreamListener.h" michael@0: #include "nsHashPropertyBag.h" michael@0: michael@0: namespace IPC { michael@0: class URI; michael@0: } michael@0: michael@0: namespace mozilla { michael@0: michael@0: namespace ipc { michael@0: class OptionalURIParams; michael@0: } // namespace ipc michael@0: michael@0: namespace net { michael@0: class PChannelDiverterParent; michael@0: } // namespace net michael@0: michael@0: namespace dom { michael@0: michael@0: class ContentParent; michael@0: class PBrowserParent; michael@0: michael@0: class ExternalHelperAppParent : public PExternalHelperAppParent michael@0: , public nsHashPropertyBag michael@0: , public nsIChannel michael@0: , public nsIMultiPartChannel michael@0: , public nsIResumableChannel michael@0: , public nsIStreamListener michael@0: { michael@0: typedef mozilla::ipc::OptionalURIParams OptionalURIParams; michael@0: michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIREQUEST michael@0: NS_DECL_NSICHANNEL michael@0: NS_DECL_NSIMULTIPARTCHANNEL michael@0: NS_DECL_NSIRESUMABLECHANNEL michael@0: NS_DECL_NSISTREAMLISTENER michael@0: NS_DECL_NSIREQUESTOBSERVER michael@0: michael@0: bool RecvOnStartRequest(const nsCString& entityID) MOZ_OVERRIDE; michael@0: bool RecvOnDataAvailable(const nsCString& data, michael@0: const uint64_t& offset, michael@0: const uint32_t& count) MOZ_OVERRIDE; michael@0: bool RecvOnStopRequest(const nsresult& code) MOZ_OVERRIDE; michael@0: michael@0: bool RecvDivertToParentUsing(PChannelDiverterParent* diverter) MOZ_OVERRIDE; michael@0: michael@0: ExternalHelperAppParent(const OptionalURIParams& uri, const int64_t& contentLength); michael@0: void Init(ContentParent *parent, michael@0: const nsCString& aMimeContentType, michael@0: const nsCString& aContentDisposition, michael@0: const uint32_t& aContentDispositionHint, michael@0: const nsString& aContentDispositionFilename, michael@0: const bool& aForceSave, michael@0: const OptionalURIParams& aReferrer, michael@0: PBrowserParent* aBrowser); michael@0: virtual ~ExternalHelperAppParent(); michael@0: michael@0: protected: michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; michael@0: void Delete(); michael@0: michael@0: private: michael@0: nsCOMPtr mListener; michael@0: nsCOMPtr mURI; michael@0: bool mPending; michael@0: DebugOnly mDiverted; michael@0: bool mIPCClosed; michael@0: nsLoadFlags mLoadFlags; michael@0: nsresult mStatus; michael@0: int64_t mContentLength; michael@0: uint32_t mContentDisposition; michael@0: nsString mContentDispositionFilename; michael@0: nsCString mContentDispositionHeader; michael@0: nsCString mEntityID; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla