uriloader/exthandler/ExternalHelperAppParent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/uriloader/exthandler/ExternalHelperAppParent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,90 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=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 "mozilla/dom/PExternalHelperAppParent.h"
    1.11 +#include "nsIChannel.h"
    1.12 +#include "nsIMultiPartChannel.h"
    1.13 +#include "nsIResumableChannel.h"
    1.14 +#include "nsIStreamListener.h"
    1.15 +#include "nsHashPropertyBag.h"
    1.16 +
    1.17 +namespace IPC {
    1.18 +class URI;
    1.19 +}
    1.20 +
    1.21 +namespace mozilla {
    1.22 +
    1.23 +namespace ipc {
    1.24 +class OptionalURIParams;
    1.25 +} // namespace ipc
    1.26 +
    1.27 +namespace net {
    1.28 +class PChannelDiverterParent;
    1.29 +} // namespace net
    1.30 +
    1.31 +namespace dom {
    1.32 +
    1.33 +class ContentParent;
    1.34 +class PBrowserParent;
    1.35 +
    1.36 +class ExternalHelperAppParent : public PExternalHelperAppParent
    1.37 +                              , public nsHashPropertyBag
    1.38 +                              , public nsIChannel
    1.39 +                              , public nsIMultiPartChannel
    1.40 +                              , public nsIResumableChannel
    1.41 +                              , public nsIStreamListener
    1.42 +{
    1.43 +    typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
    1.44 +
    1.45 +public:
    1.46 +    NS_DECL_ISUPPORTS
    1.47 +    NS_DECL_NSIREQUEST
    1.48 +    NS_DECL_NSICHANNEL
    1.49 +    NS_DECL_NSIMULTIPARTCHANNEL
    1.50 +    NS_DECL_NSIRESUMABLECHANNEL
    1.51 +    NS_DECL_NSISTREAMLISTENER
    1.52 +    NS_DECL_NSIREQUESTOBSERVER
    1.53 +
    1.54 +    bool RecvOnStartRequest(const nsCString& entityID) MOZ_OVERRIDE;
    1.55 +    bool RecvOnDataAvailable(const nsCString& data,
    1.56 +                             const uint64_t& offset,
    1.57 +                             const uint32_t& count) MOZ_OVERRIDE;
    1.58 +    bool RecvOnStopRequest(const nsresult& code) MOZ_OVERRIDE;
    1.59 +
    1.60 +    bool RecvDivertToParentUsing(PChannelDiverterParent* diverter) MOZ_OVERRIDE;
    1.61 +
    1.62 +    ExternalHelperAppParent(const OptionalURIParams& uri, const int64_t& contentLength);
    1.63 +    void Init(ContentParent *parent,
    1.64 +              const nsCString& aMimeContentType,
    1.65 +              const nsCString& aContentDisposition,
    1.66 +              const uint32_t& aContentDispositionHint,
    1.67 +              const nsString& aContentDispositionFilename,
    1.68 +              const bool& aForceSave,
    1.69 +              const OptionalURIParams& aReferrer,
    1.70 +              PBrowserParent* aBrowser);
    1.71 +    virtual ~ExternalHelperAppParent();
    1.72 +
    1.73 +protected:
    1.74 +  virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
    1.75 +  void Delete();
    1.76 +
    1.77 +private:
    1.78 +  nsCOMPtr<nsIStreamListener> mListener;
    1.79 +  nsCOMPtr<nsIURI> mURI;
    1.80 +  bool mPending;
    1.81 +  DebugOnly<bool> mDiverted;
    1.82 +  bool mIPCClosed;
    1.83 +  nsLoadFlags mLoadFlags;
    1.84 +  nsresult mStatus;
    1.85 +  int64_t mContentLength;
    1.86 +  uint32_t mContentDisposition;
    1.87 +  nsString mContentDispositionFilename;
    1.88 +  nsCString mContentDispositionHeader;
    1.89 +  nsCString mEntityID;
    1.90 +};
    1.91 +
    1.92 +} // namespace dom
    1.93 +} // namespace mozilla

mercurial