Pull the new r369476 of base library from Chromium
The merge was done against r369476 which corresponds to git commit
0471d0e2e2ef4a544a63481a389e1df33ea7c00a of Jan 14, 2016
Change-Id: Ie6894cf65424cc5ad115110faccd51602b2d1234
Reviewed-on: https://weave-review.googlesource.com/2225
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
diff --git a/third_party/chromium/base/strings/string_number_conversions.h b/third_party/chromium/base/strings/string_number_conversions.h
index c68d0af..af0faa6 100644
--- a/third_party/chromium/base/strings/string_number_conversions.h
+++ b/third_party/chromium/base/strings/string_number_conversions.h
@@ -5,11 +5,13 @@
#ifndef BASE_STRINGS_STRING_NUMBER_CONVERSIONS_H_
#define BASE_STRINGS_STRING_NUMBER_CONVERSIONS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
#include "base/base_export.h"
-#include "base/basictypes.h"
#include "base/strings/string_piece.h"
// ----------------------------------------------------------------------------
@@ -32,12 +34,13 @@
std::string UintToString(unsigned value);
-std::string Int64ToString(int64 value);
+std::string Int64ToString(int64_t value);
-std::string Uint64ToString(uint64 value);
+std::string Uint64ToString(uint64_t value);
std::string SizeTToString(size_t value);
+// Deprecated: prefer std::to_string(double) instead.
// DoubleToString converts the double to a string format that ignores the
// locale. If you want to use locale specific formatting, use ICU.
std::string DoubleToString(double value);
@@ -58,22 +61,27 @@
// - No characters parseable as a number at the beginning of the string.
// |*output| will be set to 0.
// - Empty string. |*output| will be set to 0.
+// WARNING: Will write to |output| even when returning false.
+// Read the comments above carefully.
bool StringToInt(const StringPiece& input, int* output);
bool StringToUint(const StringPiece& input, unsigned* output);
-bool StringToInt64(const StringPiece& input, int64* output);
+bool StringToInt64(const StringPiece& input, int64_t* output);
-bool StringToUint64(const StringPiece& input, uint64* output);
+bool StringToUint64(const StringPiece& input, uint64_t* output);
bool StringToSizeT(const StringPiece& input, size_t* output);
+// Deprecated: prefer std::stod() instead.
// For floating-point conversions, only conversions of input strings in decimal
// form are defined to work. Behavior with strings representing floating-point
-// numbers in hexadecimal, and strings representing non-fininte values (such as
+// numbers in hexadecimal, and strings representing non-finite values (such as
// NaN and inf) is undefined. Otherwise, these behave the same as the integral
// variants. This expects the input string to NOT be specific to the locale.
// If your input is locale specific, use ICU to read the number.
+// WARNING: Will write to |output| even when returning false.
+// Read the comments here and above StringToInt() carefully.
bool StringToDouble(const std::string& input, double* output);
// Hex encoding ----------------------------------------------------------------
@@ -95,24 +103,25 @@
// Will only successful parse hex values that will fit into |output|, i.e.
// 0x00000000 < |input| < 0xFFFFFFFF.
// The string is not required to start with 0x.
-bool HexStringToUInt(const StringPiece& input, uint32* output);
+bool HexStringToUInt(const StringPiece& input, uint32_t* output);
// Best effort conversion, see StringToInt above for restrictions.
// Will only successful parse hex values that will fit into |output|, i.e.
// -0x8000000000000000 < |input| < 0x7FFFFFFFFFFFFFFF.
-bool HexStringToInt64(const StringPiece& input, int64* output);
+bool HexStringToInt64(const StringPiece& input, int64_t* output);
// Best effort conversion, see StringToInt above for restrictions.
// Will only successful parse hex values that will fit into |output|, i.e.
// 0x0000000000000000 < |input| < 0xFFFFFFFFFFFFFFFF.
// The string is not required to start with 0x.
-bool HexStringToUInt64(const StringPiece& input, uint64* output);
+bool HexStringToUInt64(const StringPiece& input, uint64_t* output);
// Similar to the previous functions, except that output is a vector of bytes.
// |*output| will contain as many bytes as were successfully parsed prior to the
// error. There is no overflow, but input.size() must be evenly divisible by 2.
// Leading 0x or +/- are not allowed.
-bool HexStringToBytes(const std::string& input, std::vector<uint8>* output);
+bool HexStringToBytes(const std::string& input,
+ std::vector<uint8_t>* output);
} // namespace base