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 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #pragma once |
michael@0 | 6 | |
michael@0 | 7 | #include <vector> |
michael@0 | 8 | #include "base/linked_ptr.h" |
michael@0 | 9 | #include "nsAutoPtr.h" |
michael@0 | 10 | |
michael@0 | 11 | #ifndef DECLARE_PTR |
michael@0 | 12 | #define DECLARE_PTR(className)\ |
michael@0 | 13 | class className;\ |
michael@0 | 14 | typedef linked_ptr<className> className##Ptr; |
michael@0 | 15 | #endif |
michael@0 | 16 | |
michael@0 | 17 | |
michael@0 | 18 | #ifndef DECLARE_PTR_VECTOR |
michael@0 | 19 | #define DECLARE_PTR_VECTOR(className)\ |
michael@0 | 20 | DECLARE_PTR(className)\ |
michael@0 | 21 | typedef std::vector<className##Ptr> className##Vtr;\ |
michael@0 | 22 | typedef linked_ptr<className##Vtr> className##Vtr##Ptr; |
michael@0 | 23 | #endif |
michael@0 | 24 | |
michael@0 | 25 | |
michael@0 | 26 | #ifndef NULL_PTR |
michael@0 | 27 | #define NULL_PTR(className) linked_ptr<className>() |
michael@0 | 28 | #endif |
michael@0 | 29 | |
michael@0 | 30 | // NSPR Variations of the above, to help with migration |
michael@0 | 31 | // from linked_ptr to nsRefPtr |
michael@0 | 32 | #ifndef DECLARE_NS_PTR |
michael@0 | 33 | #define DECLARE_NS_PTR(className)\ |
michael@0 | 34 | class className;\ |
michael@0 | 35 | typedef nsRefPtr<className> className##Ptr; |
michael@0 | 36 | #endif |
michael@0 | 37 | |
michael@0 | 38 | |
michael@0 | 39 | #ifndef DECLARE_NS_PTR_VECTOR |
michael@0 | 40 | #define DECLARE_NS_PTR_VECTOR(className)\ |
michael@0 | 41 | DECLARE_NS_PTR(className)\ |
michael@0 | 42 | typedef std::vector<className##Ptr> className##Vtr;\ |
michael@0 | 43 | typedef linked_ptr<className##Vtr> className##Vtr##Ptr; |
michael@0 | 44 | #endif |