2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-19 02:01:16 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1999-09-17 20:12:41 +04:00
|
|
|
*
|
2004-04-19 02:01:16 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1999-09-17 20:12:41 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1999-09-17 20:12:41 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-19 02:01:16 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
2004-04-19 02:01:16 +04:00
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
2001-09-29 00:14:13 +04:00
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-19 02:01:16 +04:00
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
2001-09-29 00:14:13 +04:00
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-19 02:01:16 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-19 02:01:16 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
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"
|
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"
|
|
|
|
#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
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
class nsJARChannel : public nsIJARChannel
|
|
|
|
, public nsIDownloadObserver
|
|
|
|
, public nsIStreamListener
|
1999-11-08 00:55:12 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
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
|
2002-03-13 03:34:54 +03:00
|
|
|
|
1999-09-17 20:12:41 +04:00
|
|
|
nsJARChannel();
|
|
|
|
virtual ~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:
|
2003-06-24 02:58:28 +04:00
|
|
|
nsresult CreateJarInput(nsIZipReaderCache *);
|
2003-01-18 05:15:14 +03:00
|
|
|
nsresult EnsureJarInput(PRBool blocking);
|
1999-12-04 13:01:32 +03: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
|
|
|
|
|
|
|
nsCOMPtr<nsIJARURI> mJarURI;
|
|
|
|
nsCOMPtr<nsIURI> mOriginalURI;
|
|
|
|
nsCOMPtr<nsISupports> mOwner;
|
|
|
|
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;
|
|
|
|
PRInt32 mContentLength;
|
|
|
|
PRUint32 mLoadFlags;
|
|
|
|
nsresult mStatus;
|
2007-11-27 08:32:23 +03:00
|
|
|
PRPackedBool mIsPending;
|
|
|
|
PRPackedBool mIsUnsafe;
|
2003-01-18 05:15:14 +03:00
|
|
|
|
|
|
|
nsJARInputThunk *mJarInput;
|
2003-06-24 02:58:28 +04:00
|
|
|
nsCOMPtr<nsIStreamListener> mDownloader;
|
2003-01-18 05:15:14 +03:00
|
|
|
nsCOMPtr<nsIInputStreamPump> mPump;
|
|
|
|
nsCOMPtr<nsIFile> mJarFile;
|
|
|
|
nsCOMPtr<nsIURI> mJarBaseURI;
|
|
|
|
nsCString mJarEntry;
|
1999-09-17 20:12:41 +04:00
|
|
|
};
|
|
|
|
|
1999-11-08 00:55:12 +03:00
|
|
|
#endif // nsJARChannel_h__
|