caps/src/nsNullPrincipalURI.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 * vim: sw=2 ts=2 sts=2 expandtab
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 /**
michael@0 8 * This wraps nsSimpleURI so that all calls to it are done on the main thread.
michael@0 9 */
michael@0 10
michael@0 11 #ifndef __nsNullPrincipalURI_h__
michael@0 12 #define __nsNullPrincipalURI_h__
michael@0 13
michael@0 14 #include "nsIURI.h"
michael@0 15 #include "nsISizeOf.h"
michael@0 16 #include "nsAutoPtr.h"
michael@0 17 #include "nsString.h"
michael@0 18 #include "mozilla/Attributes.h"
michael@0 19 #include "mozilla/MemoryReporting.h"
michael@0 20
michael@0 21 // {51fcd543-3b52-41f7-b91b-6b54102236e6}
michael@0 22 #define NS_NULLPRINCIPALURI_IMPLEMENTATION_CID \
michael@0 23 {0x51fcd543, 0x3b52, 0x41f7, \
michael@0 24 {0xb9, 0x1b, 0x6b, 0x54, 0x10, 0x22, 0x36, 0xe6} }
michael@0 25
michael@0 26 class nsNullPrincipalURI MOZ_FINAL : public nsIURI
michael@0 27 , public nsISizeOf
michael@0 28 {
michael@0 29 public:
michael@0 30 NS_DECL_THREADSAFE_ISUPPORTS
michael@0 31 NS_DECL_NSIURI
michael@0 32
michael@0 33 // nsISizeOf
michael@0 34 virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
michael@0 35 virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
michael@0 36
michael@0 37 nsNullPrincipalURI(const nsCString &aSpec);
michael@0 38
michael@0 39 private:
michael@0 40 nsCString mScheme;
michael@0 41 nsCString mPath;
michael@0 42 };
michael@0 43
michael@0 44 #endif // __nsNullPrincipalURI_h__

mercurial