Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
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: 4; 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 | /* The privileged system principal. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef nsSystemPrincipal_h__ |
michael@0 | 9 | #define nsSystemPrincipal_h__ |
michael@0 | 10 | |
michael@0 | 11 | #include "nsIPrincipal.h" |
michael@0 | 12 | #include "nsJSPrincipals.h" |
michael@0 | 13 | |
michael@0 | 14 | #define NS_SYSTEMPRINCIPAL_CID \ |
michael@0 | 15 | { 0x4a6212db, 0xaccb, 0x11d3, \ |
michael@0 | 16 | { 0xb7, 0x65, 0x0, 0x60, 0xb0, 0xb6, 0xce, 0xcb }} |
michael@0 | 17 | #define NS_SYSTEMPRINCIPAL_CONTRACTID "@mozilla.org/systemprincipal;1" |
michael@0 | 18 | |
michael@0 | 19 | |
michael@0 | 20 | class nsSystemPrincipal : public nsJSPrincipals |
michael@0 | 21 | { |
michael@0 | 22 | public: |
michael@0 | 23 | // Our refcount is managed by nsJSPrincipals. Use this macro to avoid |
michael@0 | 24 | // an extra refcount member. |
michael@0 | 25 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 26 | NS_DECL_NSIPRINCIPAL |
michael@0 | 27 | NS_DECL_NSISERIALIZABLE |
michael@0 | 28 | |
michael@0 | 29 | nsSystemPrincipal(); |
michael@0 | 30 | |
michael@0 | 31 | virtual void GetScriptLocation(nsACString &aStr) MOZ_OVERRIDE; |
michael@0 | 32 | |
michael@0 | 33 | #ifdef DEBUG |
michael@0 | 34 | virtual void dumpImpl() MOZ_OVERRIDE; |
michael@0 | 35 | #endif |
michael@0 | 36 | |
michael@0 | 37 | protected: |
michael@0 | 38 | virtual ~nsSystemPrincipal(void); |
michael@0 | 39 | |
michael@0 | 40 | // XXX Probably unnecessary. See bug 143559. |
michael@0 | 41 | NS_DECL_OWNINGTHREAD |
michael@0 | 42 | }; |
michael@0 | 43 | |
michael@0 | 44 | #endif // nsSystemPrincipal_h__ |