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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsIconChannel_h_ |
michael@0 | 7 | #define nsIconChannel_h_ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/Attributes.h" |
michael@0 | 10 | |
michael@0 | 11 | #include "nsIChannel.h" |
michael@0 | 12 | #include "nsIURI.h" |
michael@0 | 13 | #include "nsIIconURI.h" |
michael@0 | 14 | #include "nsCOMPtr.h" |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * This class is the Android implementation of nsIconChannel. |
michael@0 | 18 | * It asks Android for an icon, and creates a new channel for |
michael@0 | 19 | * that file to which all calls will be proxied. |
michael@0 | 20 | */ |
michael@0 | 21 | class nsIconChannel MOZ_FINAL : public nsIChannel { |
michael@0 | 22 | public: |
michael@0 | 23 | NS_DECL_ISUPPORTS |
michael@0 | 24 | NS_FORWARD_NSIREQUEST(mRealChannel->) |
michael@0 | 25 | NS_FORWARD_NSICHANNEL(mRealChannel->) |
michael@0 | 26 | |
michael@0 | 27 | nsIconChannel() {} |
michael@0 | 28 | ~nsIconChannel() {} |
michael@0 | 29 | |
michael@0 | 30 | /** |
michael@0 | 31 | * Called by nsIconProtocolHandler after it creates this channel. |
michael@0 | 32 | * Must be called before calling any other function on this object. |
michael@0 | 33 | * If this method fails, no other function must be called on this object. |
michael@0 | 34 | */ |
michael@0 | 35 | NS_HIDDEN_(nsresult) Init(nsIURI* aURI); |
michael@0 | 36 | private: |
michael@0 | 37 | /** |
michael@0 | 38 | * The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html). |
michael@0 | 39 | * Will always be non-null after a successful Init. |
michael@0 | 40 | */ |
michael@0 | 41 | nsCOMPtr<nsIChannel> mRealChannel; |
michael@0 | 42 | }; |
michael@0 | 43 | |
michael@0 | 44 | #endif |