Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsIconChannel_h___
8 #define nsIconChannel_h___
10 #include "mozilla/Attributes.h"
12 #include "nsCOMPtr.h"
13 #include "nsXPIDLString.h"
14 #include "nsIChannel.h"
15 #include "nsILoadGroup.h"
16 #include "nsIInterfaceRequestor.h"
17 #include "nsIInterfaceRequestorUtils.h"
18 #include "nsIURI.h"
19 #include "nsIInputStreamPump.h"
20 #include "nsIStreamListener.h"
21 #include "nsIIconURI.h"
23 #include <windows.h>
25 class nsIFile;
27 class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
28 {
29 public:
30 NS_DECL_THREADSAFE_ISUPPORTS
31 NS_DECL_NSIREQUEST
32 NS_DECL_NSICHANNEL
33 NS_DECL_NSIREQUESTOBSERVER
34 NS_DECL_NSISTREAMLISTENER
36 nsIconChannel();
37 ~nsIconChannel();
39 nsresult Init(nsIURI* uri);
41 protected:
42 nsCOMPtr<nsIURI> mUrl;
43 nsCOMPtr<nsIURI> mOriginalURI;
44 int64_t mContentLength;
45 nsCOMPtr<nsILoadGroup> mLoadGroup;
46 nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
47 nsCOMPtr<nsISupports> mOwner;
49 nsCOMPtr<nsIInputStreamPump> mPump;
50 nsCOMPtr<nsIStreamListener> mListener;
52 nsresult ExtractIconInfoFromUrl(nsIFile ** aLocalFile, uint32_t * aDesiredImageSize, nsCString &aContentType, nsCString &aFileExtension);
53 nsresult GetHIconFromFile(HICON *hIcon);
54 nsresult MakeInputStream(nsIInputStream** _retval, bool nonBlocking);
56 // Functions specific to Vista and above
57 protected:
58 nsresult GetStockHIcon(nsIMozIconURI *aIconURI, HICON *hIcon);
59 };
61 #endif /* nsIconChannel_h___ */