mfbt/double-conversion/add-mfbt-api-markers.patch

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 diff --git a/mfbt/double-conversion/double-conversion.h b/mfbt/double-conversion/double-conversion.h
     2 index f98edae..c62b16b 100644
     3 --- a/mfbt/double-conversion/double-conversion.h
     4 +++ b/mfbt/double-conversion/double-conversion.h
     5 @@ -28,6 +28,7 @@
     6  #ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
     7  #define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
     9 +#include "mozilla/Types.h"
    10  #include "utils.h"
    12  namespace double_conversion {
    13 @@ -129,7 +130,7 @@ class DoubleToStringConverter {
    14    }
    16    // Returns a converter following the EcmaScript specification.
    17 -  static const DoubleToStringConverter& EcmaScriptConverter();
    18 +  static MFBT_API const DoubleToStringConverter& EcmaScriptConverter();
    20    // Computes the shortest string of digits that correctly represent the input
    21    // number. Depending on decimal_in_shortest_low and decimal_in_shortest_high
    22 @@ -197,7 +198,7 @@ class DoubleToStringConverter {
    23    // The last two conditions imply that the result will never contain more than
    24    // 1 + kMaxFixedDigitsBeforePoint + 1 + kMaxFixedDigitsAfterPoint characters
    25    // (one additional character for the sign, and one for the decimal point).
    26 -  bool ToFixed(double value,
    27 +  MFBT_API bool ToFixed(double value,
    28                 int requested_digits,
    29                 StringBuilder* result_builder) const;
    31 @@ -229,7 +230,7 @@ class DoubleToStringConverter {
    32    // kMaxExponentialDigits + 8 characters (the sign, the digit before the
    33    // decimal point, the decimal point, the exponent character, the
    34    // exponent's sign, and at most 3 exponent digits).
    35 -  bool ToExponential(double value,
    36 +  MFBT_API bool ToExponential(double value,
    37                       int requested_digits,
    38                       StringBuilder* result_builder) const;
    40 @@ -267,7 +268,7 @@ class DoubleToStringConverter {
    41    // The last condition implies that the result will never contain more than
    42    // kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the
    43    // exponent character, the exponent's sign, and at most 3 exponent digits).
    44 -  bool ToPrecision(double value,
    45 +  MFBT_API bool ToPrecision(double value,
    46                     int precision,
    47                     StringBuilder* result_builder) const;
    49 @@ -292,7 +293,7 @@ class DoubleToStringConverter {
    50    // kBase10MaximalLength.
    51    // Note that DoubleToAscii null-terminates its input. So the given buffer
    52    // should be at least kBase10MaximalLength + 1 characters long.
    53 -  static const int kBase10MaximalLength = 17;
    54 +  static const MFBT_DATA int kBase10MaximalLength = 17;
    56    // Converts the given double 'v' to ascii. 'v' must not be NaN, +Infinity, or
    57    // -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to 'v'
    58 @@ -332,7 +333,7 @@ class DoubleToStringConverter {
    59    // terminating null-character when computing the maximal output size.
    60    // The given length is only used in debug mode to ensure the buffer is big
    61    // enough.
    62 -  static void DoubleToAscii(double v,
    63 +  static MFBT_API void DoubleToAscii(double v,
    64                              DtoaMode mode,
    65                              int requested_digits,
    66                              char* buffer,
    67 @@ -343,7 +344,7 @@ class DoubleToStringConverter {
    69   private:
    70    // Implementation for ToShortest and ToShortestSingle.
    71 -  bool ToShortestIeeeNumber(double value,
    72 +  MFBT_API bool ToShortestIeeeNumber(double value,
    73                              StringBuilder* result_builder,
    74                              DtoaMode mode) const;
    76 @@ -351,15 +352,15 @@ class DoubleToStringConverter {
    77    // corresponding string using the configured infinity/nan-symbol.
    78    // If either of them is NULL or the value is not special then the
    79    // function returns false.
    80 -  bool HandleSpecialValues(double value, StringBuilder* result_builder) const;
    81 +  MFBT_API bool HandleSpecialValues(double value, StringBuilder* result_builder) const;
    82    // Constructs an exponential representation (i.e. 1.234e56).
    83    // The given exponent assumes a decimal point after the first decimal digit.
    84 -  void CreateExponentialRepresentation(const char* decimal_digits,
    85 +  MFBT_API void CreateExponentialRepresentation(const char* decimal_digits,
    86                                         int length,
    87                                         int exponent,
    88                                         StringBuilder* result_builder) const;
    89    // Creates a decimal representation (i.e 1234.5678).
    90 -  void CreateDecimalRepresentation(const char* decimal_digits,
    91 +  MFBT_API void CreateDecimalRepresentation(const char* decimal_digits,
    92                                     int length,
    93                                     int decimal_point,
    94                                     int digits_after_point,

mercurial