2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
1999-09-17 20:12:41 +04:00
|
|
|
|
1999-11-08 00:55:12 +03:00
|
|
|
#ifndef nsJARChannel_h__
|
|
|
|
#define nsJARChannel_h__
|
1999-09-17 20:12:41 +04:00
|
|
|
|
1999-11-08 00:55:12 +03:00
|
|
|
#include "nsIJARChannel.h"
|
1999-11-12 09:13:13 +03:00
|
|
|
#include "nsIJARURI.h"
|
2003-01-18 05:15:14 +03:00
|
|
|
#include "nsIInputStreamPump.h"
|
1999-11-24 11:31:06 +03:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2003-01-18 05:15:14 +03:00
|
|
|
#include "nsIProgressEventSink.h"
|
|
|
|
#include "nsIStreamListener.h"
|
2012-12-22 17:56:21 +04:00
|
|
|
#include "nsIRemoteOpenFileListener.h"
|
2003-06-24 02:58:28 +04:00
|
|
|
#include "nsIZipReader.h"
|
2000-09-22 10:21:18 +04:00
|
|
|
#include "nsIDownloader.h"
|
2003-01-18 05:15:14 +03:00
|
|
|
#include "nsILoadGroup.h"
|
2014-07-10 10:56:36 +04:00
|
|
|
#include "nsILoadInfo.h"
|
2014-06-17 20:39:23 +04:00
|
|
|
#include "nsIThreadRetargetableRequest.h"
|
|
|
|
#include "nsIThreadRetargetableStreamListener.h"
|
2009-02-19 23:25:18 +03:00
|
|
|
#include "nsHashPropertyBag.h"
|
2003-01-18 05:15:14 +03:00
|
|
|
#include "nsIFile.h"
|
|
|
|
#include "nsIURI.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2002-03-06 10:48:55 +03:00
|
|
|
#include "nsString.h"
|
2003-01-18 05:15:14 +03:00
|
|
|
#include "prlog.h"
|
1999-09-17 20:12:41 +04:00
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
class nsJARInputThunk;
|
1999-09-17 20:12:41 +04:00
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
//-----------------------------------------------------------------------------
|
1999-11-08 00:55:12 +03:00
|
|
|
|
2014-08-27 22:26:48 +04:00
|
|
|
class nsJARChannel MOZ_FINAL : public nsIJARChannel
|
|
|
|
, public nsIDownloadObserver
|
|
|
|
, public nsIStreamListener
|
|
|
|
, public nsIRemoteOpenFileListener
|
|
|
|
, public nsIThreadRetargetableRequest
|
|
|
|
, public nsIThreadRetargetableStreamListener
|
|
|
|
, public nsHashPropertyBag
|
1999-11-08 00:55:12 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-07-14 23:21:34 +04:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
1999-11-08 00:55:12 +03:00
|
|
|
NS_DECL_NSIREQUEST
|
|
|
|
NS_DECL_NSICHANNEL
|
1999-09-17 20:12:41 +04:00
|
|
|
NS_DECL_NSIJARCHANNEL
|
2003-01-18 05:15:14 +03:00
|
|
|
NS_DECL_NSIDOWNLOADOBSERVER
|
2001-04-10 10:01:08 +04:00
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
1999-11-08 00:55:12 +03:00
|
|
|
NS_DECL_NSISTREAMLISTENER
|
2012-12-22 17:56:21 +04:00
|
|
|
NS_DECL_NSIREMOTEOPENFILELISTENER
|
2014-06-17 20:39:23 +04:00
|
|
|
NS_DECL_NSITHREADRETARGETABLEREQUEST
|
|
|
|
NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
|
2002-03-13 03:34:54 +03:00
|
|
|
|
1999-09-17 20:12:41 +04:00
|
|
|
nsJARChannel();
|
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
nsresult Init(nsIURI *uri);
|
1999-11-08 00:55:12 +03:00
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
private:
|
2014-06-17 20:39:23 +04:00
|
|
|
virtual ~nsJARChannel();
|
|
|
|
|
2012-11-28 22:12:56 +04:00
|
|
|
nsresult CreateJarInput(nsIZipReaderCache *, nsJARInputThunk **);
|
2014-09-15 21:00:08 +04:00
|
|
|
nsresult LookupFile(bool aAllowAsync);
|
2013-02-16 02:27:21 +04:00
|
|
|
nsresult OpenLocalFile();
|
|
|
|
void NotifyError(nsresult aError);
|
2014-06-17 20:39:23 +04:00
|
|
|
void FireOnProgress(uint64_t aProgress);
|
2014-08-21 15:09:35 +04:00
|
|
|
nsresult SetRemoteNSPRFileDesc(PRFileDesc *fd);
|
2014-06-17 20:39:23 +04:00
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
#if defined(PR_LOGGING)
|
|
|
|
nsCString mSpec;
|
2001-09-19 03:07:57 +04:00
|
|
|
#endif
|
2003-01-18 05:15:14 +03:00
|
|
|
|
2012-08-28 03:34:30 +04:00
|
|
|
bool mOpened;
|
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
nsCOMPtr<nsIJARURI> mJarURI;
|
|
|
|
nsCOMPtr<nsIURI> mOriginalURI;
|
2012-07-11 19:38:36 +04:00
|
|
|
nsCOMPtr<nsIURI> mAppURI;
|
2003-01-18 05:15:14 +03:00
|
|
|
nsCOMPtr<nsISupports> mOwner;
|
2014-07-10 10:56:36 +04:00
|
|
|
nsCOMPtr<nsILoadInfo> mLoadInfo;
|
2003-01-18 05:15:14 +03:00
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
2004-04-21 18:58:45 +04:00
|
|
|
nsCOMPtr<nsISupports> mSecurityInfo;
|
2003-01-18 05:15:14 +03:00
|
|
|
nsCOMPtr<nsIProgressEventSink> mProgressSink;
|
|
|
|
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
|
|
|
nsCOMPtr<nsIStreamListener> mListener;
|
|
|
|
nsCOMPtr<nsISupports> mListenerContext;
|
|
|
|
nsCString mContentType;
|
|
|
|
nsCString mContentCharset;
|
2011-09-10 02:41:04 +04:00
|
|
|
nsCString mContentDispositionHeader;
|
|
|
|
/* mContentDisposition is uninitialized if mContentDispositionHeader is
|
|
|
|
* empty */
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mContentDisposition;
|
2012-10-22 21:51:07 +04:00
|
|
|
int64_t mContentLength;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mLoadFlags;
|
2003-01-18 05:15:14 +03:00
|
|
|
nsresult mStatus;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIsPending;
|
|
|
|
bool mIsUnsafe;
|
2012-12-22 17:56:21 +04:00
|
|
|
bool mOpeningRemote;
|
2014-07-18 06:46:22 +04:00
|
|
|
bool mEnsureChildFd;
|
2003-01-18 05:15:14 +03:00
|
|
|
|
2003-06-24 02:58:28 +04:00
|
|
|
nsCOMPtr<nsIStreamListener> mDownloader;
|
2003-01-18 05:15:14 +03:00
|
|
|
nsCOMPtr<nsIInputStreamPump> mPump;
|
2014-06-17 20:39:23 +04:00
|
|
|
// mRequest is only non-null during OnStartRequest, so we'll have a pointer
|
|
|
|
// to the request if we get called back via RetargetDeliveryTo.
|
|
|
|
nsCOMPtr<nsIRequest> mRequest;
|
2003-01-18 05:15:14 +03:00
|
|
|
nsCOMPtr<nsIFile> mJarFile;
|
|
|
|
nsCOMPtr<nsIURI> mJarBaseURI;
|
|
|
|
nsCString mJarEntry;
|
2010-09-09 07:38:34 +04:00
|
|
|
nsCString mInnerJarEntry;
|
1999-09-17 20:12:41 +04:00
|
|
|
};
|
|
|
|
|
1999-11-08 00:55:12 +03:00
|
|
|
#endif // nsJARChannel_h__
|