1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/protocol/about/nsAboutCacheEntry.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsAboutCacheEntry_h__ 1.10 +#define nsAboutCacheEntry_h__ 1.11 + 1.12 +#include "nsIAboutModule.h" 1.13 +#include "nsICacheListener.h" 1.14 +#include "nsICacheEntryDescriptor.h" 1.15 +#include "nsCOMPtr.h" 1.16 + 1.17 +class nsIAsyncOutputStream; 1.18 +class nsIInputStream; 1.19 +class nsIURI; 1.20 +class nsCString; 1.21 + 1.22 +class nsAboutCacheEntry : public nsIAboutModule 1.23 + , public nsICacheMetaDataVisitor 1.24 + , public nsICacheListener 1.25 +{ 1.26 +public: 1.27 + NS_DECL_ISUPPORTS 1.28 + NS_DECL_NSIABOUTMODULE 1.29 + NS_DECL_NSICACHEMETADATAVISITOR 1.30 + NS_DECL_NSICACHELISTENER 1.31 + 1.32 + nsAboutCacheEntry() 1.33 + : mBuffer(nullptr) 1.34 + {} 1.35 + 1.36 + virtual ~nsAboutCacheEntry() {} 1.37 + 1.38 +private: 1.39 + nsresult GetContentStream(nsIURI *, nsIInputStream **); 1.40 + nsresult OpenCacheEntry(nsIURI *); 1.41 + nsresult WriteCacheEntryDescription(nsICacheEntryDescriptor *); 1.42 + nsresult WriteCacheEntryUnavailable(); 1.43 + nsresult ParseURI(nsIURI *, nsCString &, bool &, nsCString &); 1.44 + 1.45 +private: 1.46 + nsCString *mBuffer; 1.47 + nsCOMPtr<nsIAsyncOutputStream> mOutputStream; 1.48 +}; 1.49 + 1.50 +#define NS_ABOUT_CACHE_ENTRY_MODULE_CID \ 1.51 +{ /* 7fa5237d-b0eb-438f-9e50-ca0166e63788 */ \ 1.52 + 0x7fa5237d, \ 1.53 + 0xb0eb, \ 1.54 + 0x438f, \ 1.55 + {0x9e, 0x50, 0xca, 0x01, 0x66, 0xe6, 0x37, 0x88} \ 1.56 +} 1.57 + 1.58 +#endif // nsAboutCacheEntry_h__