1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsJARProtocolHandler_h__
7 #define nsJARProtocolHandler_h__
9 #include "mozilla/StaticPtr.h"
10 #include "nsIProtocolHandler.h"
11 #include "nsIZipReader.h"
12 #include "nsIMIMEService.h"
13 #include "nsWeakReference.h"
16 class nsJARProtocolHandler final
: public nsIProtocolHandler
,
17 public nsSupportsWeakReference
{
19 NS_DECL_THREADSAFE_ISUPPORTS
20 NS_DECL_NSIPROTOCOLHANDLER
22 // nsJARProtocolHandler methods:
23 nsJARProtocolHandler();
25 static already_AddRefed
<nsJARProtocolHandler
> GetSingleton();
29 // returns non addref'ed pointer.
30 nsIMIMEService
* MimeService();
31 nsIZipReaderCache
* JarCache() const { return mJARCache
; }
34 virtual ~nsJARProtocolHandler();
36 nsCOMPtr
<nsIZipReaderCache
> mJARCache
;
37 nsCOMPtr
<nsIMIMEService
> mMimeService
;
40 extern mozilla::StaticRefPtr
<nsJARProtocolHandler
> gJarHandler
;
42 #define NS_JARPROTOCOLHANDLER_CID \
43 { /* 0xc7e410d4-0x85f2-11d3-9f63-006008a6efe9 */ \
44 0xc7e410d4, 0x85f2, 0x11d3, { \
45 0x9f, 0x63, 0x00, 0x60, 0x08, 0xa6, 0xef, 0xe9 \
49 #endif // !nsJARProtocolHandler_h__