Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/modules/libjar/nsJARProtocolHandler.h
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
5
6
#ifndef nsJARProtocolHandler_h__
7
#define nsJARProtocolHandler_h__
8
9
#include "mozilla/StaticPtr.h"
10
#include "nsIJARProtocolHandler.h"
11
#include "nsIProtocolHandler.h"
12
#include "nsIJARURI.h"
13
#include "nsIZipReader.h"
14
#include "nsIMIMEService.h"
15
#include "nsWeakReference.h"
16
#include "nsCOMPtr.h"
17
18
class nsJARProtocolHandler final : public nsIJARProtocolHandler
19
                                 , public nsSupportsWeakReference
20
{
21
public:
22
    NS_DECL_THREADSAFE_ISUPPORTS
23
    NS_DECL_NSIPROTOCOLHANDLER
24
    NS_DECL_NSIJARPROTOCOLHANDLER
25
26
    // nsJARProtocolHandler methods:
27
    nsJARProtocolHandler();
28
29
    static already_AddRefed<nsJARProtocolHandler> GetSingleton();
30
31
    nsresult Init();
32
33
    // returns non addref'ed pointer.
34
    nsIMIMEService    *MimeService();
35
5
    nsIZipReaderCache *JarCache() { return mJARCache; }
36
protected:
37
    virtual ~nsJARProtocolHandler();
38
39
    nsCOMPtr<nsIZipReaderCache> mJARCache;
40
    nsCOMPtr<nsIMIMEService> mMimeService;
41
};
42
43
extern mozilla::StaticRefPtr<nsJARProtocolHandler> gJarHandler;
44
45
#define NS_JARPROTOCOLHANDLER_CID                    \
46
{ /* 0xc7e410d4-0x85f2-11d3-9f63-006008a6efe9 */     \
47
    0xc7e410d4,                                      \
48
    0x85f2,                                          \
49
    0x11d3,                                          \
50
    {0x9f, 0x63, 0x00, 0x60, 0x08, 0xa6, 0xef, 0xe9} \
51
}
52
53
#endif // !nsJARProtocolHandler_h__