intl/uconv/src/nsReplacementToUnicode.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.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef nsReplacementToUnicode_h_
     6 #define nsReplacementToUnicode_h_
     8 #include "nsUCSupport.h"
    10 #define NS_REPLACEMENTTOUNICODE_CID \
    11   { 0xd24b24da, 0xc607, 0x489a, \
    12     { 0xb5, 0xf0, 0x67, 0x91, 0xf4, 0x45, 0x45, 0x6d } }
    14 #define NS_REPLACEMENTTOUNICODE_CONTRACTID \
    15   "@mozilla.org/intl/unicode/decoder;1?charset=replacement"
    17 class nsReplacementToUnicode : public nsBasicDecoderSupport
    18 {
    19 public:
    20   nsReplacementToUnicode();
    22   NS_IMETHOD Convert(const char* aSrc,
    23                      int32_t* aSrcLength,
    24                      char16_t* aDest,
    25                      int32_t* aDestLength);
    27   NS_IMETHOD GetMaxLength(const char* aSrc,
    28                           int32_t aSrcLength,
    29                           int32_t* aDestLength);
    31   NS_IMETHOD Reset();
    33 private:
    34   bool mSeenByte;
    35 };
    37 #endif // nsReplacementToUnicode_h_

mercurial