platform2: Fix issues with new version of libchrome
libchrome r334380 has the following breaking changes that need to be fixed:
- base::JSONWriter::Write() and base::JSONWriter::WriteWithOptions() take
"const base::Value&" instead of "const base::Value*"
- base::JSONReader::Read() and base::JSONReader::ReadAndReturnError()
return a scoped_ptr<base::Value> instead of base::Value*
- base/safe_strerror_posix.h is moved to base/posix/safe_strerror.h
- safe_strerror() is now in "base" namespace
- StartsWithASCII(), EndsWith(), StringToUpperASCII(), LowerCaseEqualsASCII()
are now in "base" namespace
- ObserverList<T> is now in "base" namespace
- base::PrintTo(base::FilePath) used in gtest is now moved to libchrome-test
library and as such, unit test runners need to link to this library now.
- crypto::RSAPrivateKey::CreateSensitive() is now removed from //crypto, so
some of tests in chromeos-login that used that function had to be changed
to use crypto::GenerateRSAKeyPairNSS() directly.
- UnixDomanSocket class is now in "base" namespace
- Pickle class is now in "base" namespace
BUG=chromium:496469
TEST=`./build_packages`
CQ-DEPEND=CL:277662
Change-Id: I36e5fbf2e36a92068873ffbd44020c862a3ed9e3
Reviewed-on: https://chromium-review.googlesource.com/277671
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/utils.cc b/utils.cc
index 1e94ffa..8fba231 100644
--- a/utils.cc
+++ b/utils.cc
@@ -74,8 +74,8 @@
// Return true if |disk_name| is an MTD or a UBI device. Note that this test is
// simply based on the name of the device.
bool IsMtdDeviceName(const string& disk_name) {
- return StartsWithASCII(disk_name, "/dev/ubi", true) ||
- StartsWithASCII(disk_name, "/dev/mtd", true);
+ return base::StartsWithASCII(disk_name, "/dev/ubi", true) ||
+ base::StartsWithASCII(disk_name, "/dev/mtd", true);
}
// Return the device name for the corresponding partition on a NAND device.
@@ -440,7 +440,7 @@
bool SplitPartitionName(const string& partition_name,
string* out_disk_name,
int* out_partition_num) {
- if (!StartsWithASCII(partition_name, "/dev/", true)) {
+ if (!base::StartsWithASCII(partition_name, "/dev/", true)) {
LOG(ERROR) << "Invalid partition device name: " << partition_name;
return false;
}
@@ -494,7 +494,7 @@
return string();
}
- if (!StartsWithASCII(disk_name, "/dev/", true)) {
+ if (!base::StartsWithASCII(disk_name, "/dev/", true)) {
LOG(ERROR) << "Invalid disk name: " << disk_name;
return string();
}
@@ -621,8 +621,8 @@
// non-empty, prepends it to |path|. Otherwise, prepends /tmp. Returns the
// resulting path.
static const string PrependTmpdir(const string& path) {
- if (path[0] == '/' || StartsWithASCII(path, "./", true) ||
- StartsWithASCII(path, "../", true))
+ if (path[0] == '/' || base::StartsWithASCII(path, "./", true) ||
+ base::StartsWithASCII(path, "../", true))
return path;
const char *tmpdir = getenv("TMPDIR");