Update from https://crrev.com/320343
This required some manual patching to ui/event and ui/gfx.
Sky tests were suppressed.
https://github.com/domokit/mojo/issues/64
BUG=401761
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/1001833005
diff --git a/base/version.cc b/base/version.cc
index 933356e..ede8a45 100644
--- a/base/version.cc
+++ b/base/version.cc
@@ -23,7 +23,7 @@
// is the resulting integer vector. Function returns true if all numbers were
// parsed successfully, false otherwise.
bool ParseVersionNumbers(const std::string& version_str,
- std::vector<uint16>* parsed) {
+ std::vector<uint32_t>* parsed) {
std::vector<std::string> numbers;
SplitString(version_str, '.', &numbers);
if (numbers.empty())
@@ -33,22 +33,18 @@
it != numbers.end(); ++it) {
if (StartsWithASCII(*it, "+", false))
return false;
- int num;
- if (!StringToInt(*it, &num))
- return false;
-
- if (num < 0)
- return false;
-
- const uint16 max = 0xFFFF;
- if (num > max)
+ unsigned int num;
+ if (!StringToUint(*it, &num))
return false;
// This throws out leading zeros for the first item only.
- if (it == numbers.begin() && IntToString(num) != *it)
+ if (it == numbers.begin() && UintToString(num) != *it)
return false;
- parsed->push_back(static_cast<uint16>(num));
+ // StringToUint returns unsigned int but Version fields are uint32_t.
+ static_assert(sizeof (uint32_t) == sizeof (unsigned int),
+ "uint32_t must be same as unsigned int");
+ parsed->push_back(num);
}
return true;
}
@@ -56,8 +52,8 @@
// Compares version components in |components1| with components in
// |components2|. Returns -1, 0 or 1 if |components1| is less than, equal to,
// or greater than |components2|, respectively.
-int CompareVersionComponents(const std::vector<uint16>& components1,
- const std::vector<uint16>& components2) {
+int CompareVersionComponents(const std::vector<uint32_t>& components1,
+ const std::vector<uint32_t>& components2) {
const size_t count = std::min(components1.size(), components2.size());
for (size_t i = 0; i < count; ++i) {
if (components1[i] > components2[i])
@@ -88,7 +84,7 @@
}
Version::Version(const std::string& version_str) {
- std::vector<uint16> parsed;
+ std::vector<uint32_t> parsed;
if (!ParseVersionNumbers(version_str, &parsed))
return;
@@ -127,7 +123,7 @@
return CompareTo(version);
}
- std::vector<uint16> parsed;
+ std::vector<uint32_t> parsed;
const bool success = ParseVersionNumbers(
wildcard_string.substr(0, wildcard_string.length() - 2), &parsed);
DCHECK(success);