|
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 nsAboutCacheEntry_h__ |
|
7 #define nsAboutCacheEntry_h__ |
|
8 |
|
9 #include "nsIAboutModule.h" |
|
10 #include "nsICacheListener.h" |
|
11 #include "nsICacheEntryDescriptor.h" |
|
12 #include "nsCOMPtr.h" |
|
13 |
|
14 class nsIAsyncOutputStream; |
|
15 class nsIInputStream; |
|
16 class nsIURI; |
|
17 class nsCString; |
|
18 |
|
19 class nsAboutCacheEntry : public nsIAboutModule |
|
20 , public nsICacheMetaDataVisitor |
|
21 , public nsICacheListener |
|
22 { |
|
23 public: |
|
24 NS_DECL_ISUPPORTS |
|
25 NS_DECL_NSIABOUTMODULE |
|
26 NS_DECL_NSICACHEMETADATAVISITOR |
|
27 NS_DECL_NSICACHELISTENER |
|
28 |
|
29 nsAboutCacheEntry() |
|
30 : mBuffer(nullptr) |
|
31 {} |
|
32 |
|
33 virtual ~nsAboutCacheEntry() {} |
|
34 |
|
35 private: |
|
36 nsresult GetContentStream(nsIURI *, nsIInputStream **); |
|
37 nsresult OpenCacheEntry(nsIURI *); |
|
38 nsresult WriteCacheEntryDescription(nsICacheEntryDescriptor *); |
|
39 nsresult WriteCacheEntryUnavailable(); |
|
40 nsresult ParseURI(nsIURI *, nsCString &, bool &, nsCString &); |
|
41 |
|
42 private: |
|
43 nsCString *mBuffer; |
|
44 nsCOMPtr<nsIAsyncOutputStream> mOutputStream; |
|
45 }; |
|
46 |
|
47 #define NS_ABOUT_CACHE_ENTRY_MODULE_CID \ |
|
48 { /* 7fa5237d-b0eb-438f-9e50-ca0166e63788 */ \ |
|
49 0x7fa5237d, \ |
|
50 0xb0eb, \ |
|
51 0x438f, \ |
|
52 {0x9e, 0x50, 0xca, 0x01, 0x66, 0xe6, 0x37, 0x88} \ |
|
53 } |
|
54 |
|
55 #endif // nsAboutCacheEntry_h__ |