xpcom/string/public/nsTLiteralString.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:set ts=2 sw=2 sts=2 et cindent: */
     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/. */
     8   /**
     9    * nsTLiteralString_CharT
    10    *
    11    * Stores a null-terminated, immutable sequence of characters.
    12    *
    13    * Subclass of nsTString that restricts string value to a literal
    14    * character sequence.  This class does not own its data. The data is
    15    * assumed to be permanent. In practice this is true because this code
    16    * is only usable by and for libxul.
    17    */
    18 class nsTLiteralString_CharT : public nsTString_CharT
    19   {
    20     public:
    22       typedef nsTLiteralString_CharT    self_type;
    24     public:
    26         /**
    27          * constructor
    28          */
    30       template<size_type N>
    31       nsTLiteralString_CharT( const char_type (&str)[N] )
    32         : string_type(const_cast<char_type*>(str), N - 1, F_TERMINATED | F_LITERAL)
    33         {
    34         }
    36     private:
    38         // NOT TO BE IMPLEMENTED
    39       template<size_type N>
    40       nsTLiteralString_CharT( char_type (&str)[N] ) MOZ_DELETE;
    41   };

mercurial