modules/libjar/nsJARChannel.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/modules/libjar/nsJARChannel.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,94 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsJARChannel_h__
    1.10 +#define nsJARChannel_h__
    1.11 +
    1.12 +#include "nsIJARChannel.h"
    1.13 +#include "nsIJARURI.h"
    1.14 +#include "nsIInputStreamPump.h"
    1.15 +#include "nsIInterfaceRequestor.h"
    1.16 +#include "nsIProgressEventSink.h"
    1.17 +#include "nsIStreamListener.h"
    1.18 +#include "nsIRemoteOpenFileListener.h"
    1.19 +#include "nsIZipReader.h"
    1.20 +#include "nsIDownloader.h"
    1.21 +#include "nsILoadGroup.h"
    1.22 +#include "nsHashPropertyBag.h"
    1.23 +#include "nsIFile.h"
    1.24 +#include "nsIURI.h"
    1.25 +#include "nsCOMPtr.h"
    1.26 +#include "nsString.h"
    1.27 +#include "prlog.h"
    1.28 +
    1.29 +class nsJARInputThunk;
    1.30 +
    1.31 +//-----------------------------------------------------------------------------
    1.32 +
    1.33 +class nsJARChannel : public nsIJARChannel
    1.34 +                   , public nsIDownloadObserver
    1.35 +                   , public nsIStreamListener
    1.36 +                   , public nsIRemoteOpenFileListener
    1.37 +                   , public nsHashPropertyBag
    1.38 +{
    1.39 +public:
    1.40 +    NS_DECL_THREADSAFE_ISUPPORTS
    1.41 +    NS_DECL_NSIREQUEST
    1.42 +    NS_DECL_NSICHANNEL
    1.43 +    NS_DECL_NSIJARCHANNEL
    1.44 +    NS_DECL_NSIDOWNLOADOBSERVER
    1.45 +    NS_DECL_NSIREQUESTOBSERVER
    1.46 +    NS_DECL_NSISTREAMLISTENER
    1.47 +    NS_DECL_NSIREMOTEOPENFILELISTENER
    1.48 +
    1.49 +    nsJARChannel();
    1.50 +    virtual ~nsJARChannel();
    1.51 +
    1.52 +    nsresult Init(nsIURI *uri);
    1.53 +
    1.54 +private:
    1.55 +    nsresult CreateJarInput(nsIZipReaderCache *, nsJARInputThunk **);
    1.56 +    nsresult LookupFile();
    1.57 +    nsresult OpenLocalFile();
    1.58 +    void NotifyError(nsresult aError);
    1.59 +
    1.60 +#if defined(PR_LOGGING)
    1.61 +    nsCString                       mSpec;
    1.62 +#endif
    1.63 +
    1.64 +    bool                            mOpened;
    1.65 +
    1.66 +    nsCOMPtr<nsIJARURI>             mJarURI;
    1.67 +    nsCOMPtr<nsIURI>                mOriginalURI;
    1.68 +    nsCOMPtr<nsIURI>                mAppURI;
    1.69 +    nsCOMPtr<nsISupports>           mOwner;
    1.70 +    nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
    1.71 +    nsCOMPtr<nsISupports>           mSecurityInfo;
    1.72 +    nsCOMPtr<nsIProgressEventSink>  mProgressSink;
    1.73 +    nsCOMPtr<nsILoadGroup>          mLoadGroup;
    1.74 +    nsCOMPtr<nsIStreamListener>     mListener;
    1.75 +    nsCOMPtr<nsISupports>           mListenerContext;
    1.76 +    nsCString                       mContentType;
    1.77 +    nsCString                       mContentCharset;
    1.78 +    nsCString                       mContentDispositionHeader;
    1.79 +    /* mContentDisposition is uninitialized if mContentDispositionHeader is
    1.80 +     * empty */
    1.81 +    uint32_t                        mContentDisposition;
    1.82 +    int64_t                         mContentLength;
    1.83 +    uint32_t                        mLoadFlags;
    1.84 +    nsresult                        mStatus;
    1.85 +    bool                            mIsPending;
    1.86 +    bool                            mIsUnsafe;
    1.87 +    bool                            mOpeningRemote;
    1.88 +
    1.89 +    nsCOMPtr<nsIStreamListener>     mDownloader;
    1.90 +    nsCOMPtr<nsIInputStreamPump>    mPump;
    1.91 +    nsCOMPtr<nsIFile>               mJarFile;
    1.92 +    nsCOMPtr<nsIURI>                mJarBaseURI;
    1.93 +    nsCString                       mJarEntry;
    1.94 +    nsCString                       mInnerJarEntry;
    1.95 +};
    1.96 +
    1.97 +#endif // nsJARChannel_h__

mercurial