intl/uconv/util/nsUnicodeDecodeHelper.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: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef nsUnicodeDecodeHelper_h__
     6 #define nsUnicodeDecodeHelper_h__
     8 #include "nsError.h"
     9 #include "uconvutil.h"
    10 //----------------------------------------------------------------------
    11 // Class nsUnicodeDecodeHelper [declaration]
    13 /**
    14  *
    15  * @created         18/Mar/1998
    16  * @author  Catalin Rotaru [CATA]
    17  */
    18 class nsUnicodeDecodeHelper
    19 {
    20 public:
    21   /**
    22    * Converts data using a lookup table and optional shift table
    23    */
    24   static nsresult ConvertByTable(const char * aSrc, int32_t * aSrcLength, 
    25                                  char16_t * aDest, int32_t * aDestLength,
    26                                  uScanClassID aScanClass,
    27                                  uShiftInTable * aShiftInTable,
    28                                  uMappingTable  * aMappingTable,
    29                                  bool aErrorSignal = false);
    31   /**
    32    * Converts data using a set of lookup tables.
    33    */
    34   static nsresult ConvertByMultiTable(const char * aSrc, int32_t * aSrcLength,
    35       char16_t * aDest, int32_t * aDestLength, int32_t aTableCount, 
    36       const uRange * aRangeArray, uScanClassID * aScanClassArray,
    37       uMappingTable ** aMappingTable, bool aErrorSignal = false);
    39   /**
    40    * Converts data using a fast lookup table.
    41    */
    42   static nsresult ConvertByFastTable(const char * aSrc, int32_t * aSrcLength, 
    43       char16_t * aDest, int32_t * aDestLength, const char16_t * aFastTable, 
    44       int32_t aTableSize, bool aErrorSignal);
    46   /**
    47    * Create a cache-like fast lookup table from a normal one.
    48    */
    49   static nsresult CreateFastTable(uMappingTable * aMappingTable,
    50       char16_t * aFastTable,  int32_t aTableSize);
    51 };
    53 #endif // nsUnicodeDecodeHelper_h__

mercurial