caps/src/nsNullPrincipalURI.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     2  * vim: sw=2 ts=2 sts=2 expandtab
     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 /**
     8  * This wraps nsSimpleURI so that all calls to it are done on the main thread.
     9  */
    11 #ifndef __nsNullPrincipalURI_h__
    12 #define __nsNullPrincipalURI_h__
    14 #include "nsIURI.h"
    15 #include "nsISizeOf.h"
    16 #include "nsAutoPtr.h"
    17 #include "nsString.h"
    18 #include "mozilla/Attributes.h"
    19 #include "mozilla/MemoryReporting.h"
    21 // {51fcd543-3b52-41f7-b91b-6b54102236e6}
    22 #define NS_NULLPRINCIPALURI_IMPLEMENTATION_CID \
    23   {0x51fcd543, 0x3b52, 0x41f7, \
    24     {0xb9, 0x1b, 0x6b, 0x54, 0x10, 0x22, 0x36, 0xe6} }
    26 class nsNullPrincipalURI MOZ_FINAL : public nsIURI
    27                                    , public nsISizeOf
    28 {
    29 public:
    30   NS_DECL_THREADSAFE_ISUPPORTS
    31   NS_DECL_NSIURI
    33   // nsISizeOf
    34   virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
    35   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
    37   nsNullPrincipalURI(const nsCString &aSpec);
    39 private:
    40   nsCString mScheme;
    41   nsCString mPath;
    42 };
    44 #endif // __nsNullPrincipalURI_h__

mercurial