shill: Update to build against libchrome-242728.
BUG=chromium:341521
CQ-DEPEND=CL:193660
TEST=Tested the following:
1. `FEATURES=test USE='cellular wimax' emerge-$BOARD platform2`
2. Run the following tests:
- network_3GSmokeTest
- network_VPNConnect.*
- network_WiMaxSmoke
- wifi_matfunc
Change-Id: Ic1553c182ab7a833a68c45f012f646b8930cb095
Reviewed-on: https://chromium-review.googlesource.com/193606
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
diff --git a/active_passive_out_of_credits_detector.h b/active_passive_out_of_credits_detector.h
index 7d21279..3843e52 100644
--- a/active_passive_out_of_credits_detector.h
+++ b/active_passive_out_of_credits_detector.h
@@ -8,7 +8,7 @@
#include "shill/connection_health_checker.h"
#include "shill/out_of_credits_detector.h"
-#include <base/time.h>
+#include <base/time/time.h>
namespace shill {
diff --git a/attribute_list.cc b/attribute_list.cc
index c6ad1d1..927e8ce 100644
--- a/attribute_list.cc
+++ b/attribute_list.cc
@@ -14,7 +14,7 @@
#include <string>
#include <base/stl_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/logging.h"
#include "shill/netlink_attribute.h"
diff --git a/byte_string.cc b/byte_string.cc
index f521e90..d9814a6 100644
--- a/byte_string.cc
+++ b/byte_string.cc
@@ -9,7 +9,7 @@
#include <algorithm>
-#include <base/string_number_conversions.h>
+#include <base/strings/string_number_conversions.h>
using std::distance;
using std::min;
diff --git a/cellular.cc b/cellular.cc
index 41a3060..8ffaa1d 100644
--- a/cellular.cc
+++ b/cellular.cc
@@ -13,8 +13,8 @@
#include <base/bind.h>
#include <base/callback.h>
-#include <base/file_path.h>
-#include <base/stringprintf.h>
+#include <base/files/file_path.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <mobile_provider.h>
@@ -45,6 +45,7 @@
using base::Bind;
using base::Closure;
using base::FilePath;
+using base::StringPrintf;
using std::map;
using std::string;
using std::vector;
diff --git a/cellular_capability_cdma.cc b/cellular_capability_cdma.cc
index cc1b550..eaf5055 100644
--- a/cellular_capability_cdma.cc
+++ b/cellular_capability_cdma.cc
@@ -8,7 +8,7 @@
#include <vector>
#include <base/bind.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <mm/mm-modem.h>
diff --git a/cellular_capability_gsm.cc b/cellular_capability_gsm.cc
index d614b26..4fcb560 100644
--- a/cellular_capability_gsm.cc
+++ b/cellular_capability_gsm.cc
@@ -9,8 +9,8 @@
#include <base/bind.h>
#include <base/stl_util.h>
-#include <base/string_number_conversions.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <mm/mm-modem.h>
#include <mobile_provider.h>
diff --git a/cellular_capability_gsm_unittest.cc b/cellular_capability_gsm_unittest.cc
index 18a5012..e7c0450 100644
--- a/cellular_capability_gsm_unittest.cc
+++ b/cellular_capability_gsm_unittest.cc
@@ -8,7 +8,7 @@
#include <vector>
#include <base/bind.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <mm/mm-modem.h>
#include <mobile_provider.h>
diff --git a/cellular_capability_universal.cc b/cellular_capability_universal.cc
index 5d5e4df..0374470 100644
--- a/cellular_capability_universal.cc
+++ b/cellular_capability_universal.cc
@@ -6,8 +6,8 @@
#include <base/bind.h>
#include <base/stl_util.h>
-#include <base/stringprintf.h>
-#include <base/string_util.h>
+#include <base/strings/stringprintf.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include <mobile_provider.h>
#include <ModemManager/ModemManager.h>
diff --git a/cellular_capability_universal_cdma.cc b/cellular_capability_universal_cdma.cc
index 7b36dc6..8dc34e4 100644
--- a/cellular_capability_universal_cdma.cc
+++ b/cellular_capability_universal_cdma.cc
@@ -5,9 +5,9 @@
#include "shill/cellular_capability_universal_cdma.h"
#include <chromeos/dbus/service_constants.h>
-#include <base/stringprintf.h>
-#include <base/string_number_conversions.h>
-#include <base/string_util.h>
+#include <base/strings/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_util.h>
#include "shill/cellular_bearer.h"
#include "shill/cellular_operator_info.h"
diff --git a/cellular_capability_universal_cdma_unittest.cc b/cellular_capability_universal_cdma_unittest.cc
index 681fd76..cf9ddd9 100644
--- a/cellular_capability_universal_cdma_unittest.cc
+++ b/cellular_capability_universal_cdma_unittest.cc
@@ -7,8 +7,8 @@
#include <string>
#include <vector>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <ModemManager/ModemManager.h>
diff --git a/cellular_capability_universal_unittest.cc b/cellular_capability_universal_unittest.cc
index 1f3acd5..efbba72 100644
--- a/cellular_capability_universal_unittest.cc
+++ b/cellular_capability_universal_unittest.cc
@@ -8,8 +8,8 @@
#include <vector>
#include <base/bind.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <mobile_provider.h>
#include <ModemManager/ModemManager.h>
diff --git a/cellular_operator_info.cc b/cellular_operator_info.cc
index 9e6e28b..da3fdce 100644
--- a/cellular_operator_info.cc
+++ b/cellular_operator_info.cc
@@ -8,9 +8,9 @@
#include "shill/cellular_operator_info.h"
#include <base/stl_util.h>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
#include "shill/logging.h"
diff --git a/cellular_operator_info.h b/cellular_operator_info.h
index abb5f4e..dcb34be 100644
--- a/cellular_operator_info.h
+++ b/cellular_operator_info.h
@@ -15,7 +15,7 @@
#include <vector>
#include <base/basictypes.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/scoped_ptr.h>
#include <base/memory/scoped_vector.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
diff --git a/cellular_operator_info_unittest.cc b/cellular_operator_info_unittest.cc
index bb03d5c..5ac0f44 100644
--- a/cellular_operator_info_unittest.cc
+++ b/cellular_operator_info_unittest.cc
@@ -58,16 +58,16 @@
protected:
void SetUp() {
- ASSERT_TRUE(file_util::CreateTemporaryFile(&info_file_path_));
+ ASSERT_TRUE(base::CreateTemporaryFile(&info_file_path_));
ASSERT_EQ(arraysize(kTestInfoFileContent),
file_util::WriteFile(info_file_path_, kTestInfoFileContent,
arraysize(kTestInfoFileContent)));
}
void TruncateFile() {
- FILE *file = file_util::OpenFile(info_file_path_, "rw");
- file_util::TruncateFile(file);
- file_util::CloseFile(file);
+ FILE *file = base::OpenFile(info_file_path_, "rw");
+ base::TruncateFile(file);
+ base::CloseFile(file);
}
void WriteToFile(const char *content) {
@@ -81,7 +81,7 @@
}
void TearDown() {
- ASSERT_TRUE(file_util::Delete(info_file_path_, false));
+ ASSERT_TRUE(base::DeleteFile(info_file_path_, false));
}
GLib glib_;
diff --git a/cellular_service.cc b/cellular_service.cc
index c76ccd7..416a0c3 100644
--- a/cellular_service.cc
+++ b/cellular_service.cc
@@ -6,7 +6,7 @@
#include <string>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/adaptor_interfaces.h"
@@ -106,8 +106,7 @@
weak_ptr_factory_(this),
activate_over_non_cellular_network_(false),
cellular_(device),
- is_auto_connecting_(false),
- out_of_credits_detector_(NULL) {
+ is_auto_connecting_(false) {
SetConnectable(true);
PropertyStore *store = this->mutable_store();
store->RegisterConstBool(kActivateOverNonCellularNetworkProperty,
diff --git a/cellular_service.h b/cellular_service.h
index f009572..6e271f4 100644
--- a/cellular_service.h
+++ b/cellular_service.h
@@ -9,7 +9,7 @@
#include <string>
#include <base/basictypes.h>
-#include <base/time.h>
+#include <base/time/time.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
#include "shill/cellular.h"
diff --git a/certificate_file.cc b/certificate_file.cc
index a7dacce..d65bbe5 100644
--- a/certificate_file.cc
+++ b/certificate_file.cc
@@ -10,9 +10,9 @@
#include <vector>
#include <base/file_util.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include "shill/logging.h"
@@ -37,7 +37,7 @@
CertificateFile::~CertificateFile() {
SLOG(Crypto, 2) << __func__;
if (!output_file_.empty()) {
- file_util::Delete(output_file_, false);
+ base::DeleteFile(output_file_, false);
}
}
@@ -97,8 +97,8 @@
}
FilePath CertificateFile::WriteFile(const string &output_data) {
- if (!file_util::DirectoryExists(root_directory_)) {
- if (!file_util::CreateDirectory(root_directory_)) {
+ if (!base::DirectoryExists(root_directory_)) {
+ if (!base::CreateDirectory(root_directory_)) {
LOG(ERROR) << "Unable to create parent directory "
<< root_directory_.value();
return FilePath();
@@ -107,17 +107,17 @@
S_IRWXU | S_IXGRP | S_IRGRP | S_IXOTH | S_IROTH)) {
LOG(ERROR) << "Failed to set permissions on "
<< root_directory_.value();
- file_util::Delete(root_directory_, true);
+ base::DeleteFile(root_directory_, true);
return FilePath();
}
}
if (!output_file_.empty()) {
- file_util::Delete(output_file_, false);
+ base::DeleteFile(output_file_, false);
output_file_ = FilePath();
}
FilePath output_file;
- if (!file_util::CreateTemporaryFileInDir(root_directory_, &output_file)) {
+ if (!base::CreateTemporaryFileInDir(root_directory_, &output_file)) {
LOG(ERROR) << "Unable to create output file.";
return FilePath();
}
@@ -133,7 +133,7 @@
if (chmod(output_file.value().c_str(),
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) {
LOG(ERROR) << "Failed to set permissions on " << output_file.value();
- file_util::Delete(output_file, false);
+ base::DeleteFile(output_file, false);
return FilePath();
}
output_file_ = output_file;
diff --git a/certificate_file.h b/certificate_file.h
index 0a9f510..d82bdd2 100644
--- a/certificate_file.h
+++ b/certificate_file.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
namespace shill {
diff --git a/certificate_file_unittest.cc b/certificate_file_unittest.cc
index bc63d63..55824bb 100644
--- a/certificate_file_unittest.cc
+++ b/certificate_file_unittest.cc
@@ -7,10 +7,10 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -64,7 +64,7 @@
TEST_F(CertificateFileTest, Construction) {
EXPECT_TRUE(GetRootDirectory() == certificate_directory_);
- EXPECT_FALSE(file_util::PathExists(GetRootDirectory()));
+ EXPECT_FALSE(base::PathExists(GetRootDirectory()));
EXPECT_TRUE(GetOutputFile().empty());
}
@@ -73,10 +73,10 @@
const vector<string> kPEMVector0{ kPEMData };
FilePath outfile0 = certificate_file_.CreatePEMFromStrings(kPEMVector0);
EXPECT_FALSE(outfile0.empty());
- EXPECT_TRUE(file_util::PathExists(outfile0));
- EXPECT_TRUE(file_util::ContainsPath(certificate_directory_, outfile0));
+ EXPECT_TRUE(base::PathExists(outfile0));
+ EXPECT_TRUE(certificate_directory_.IsParent(outfile0));
string file_string0;
- EXPECT_TRUE(file_util::ReadFileToString(outfile0, &file_string0));
+ EXPECT_TRUE(base::ReadFileToString(outfile0, &file_string0));
string expected_output0 = StringPrintf(
"%s\n%s%s\n", GetPEMHeader(), kPEMData, GetPEMFooter());
EXPECT_EQ(expected_output0, file_string0);
@@ -85,10 +85,10 @@
const vector<string> kPEMVector1{ expected_output0, kPEMData };
FilePath outfile1 = certificate_file_.CreatePEMFromStrings(kPEMVector1);
EXPECT_FALSE(outfile1.empty());
- EXPECT_TRUE(file_util::PathExists(outfile1));
- EXPECT_FALSE(file_util::PathExists(outfile0)); // Old file is deleted.
+ EXPECT_TRUE(base::PathExists(outfile1));
+ EXPECT_FALSE(base::PathExists(outfile0)); // Old file is deleted.
string file_string1;
- EXPECT_TRUE(file_util::ReadFileToString(outfile1, &file_string1));
+ EXPECT_TRUE(base::ReadFileToString(outfile1, &file_string1));
string expected_output1 = StringPrintf(
"%s%s", expected_output0.c_str(), expected_output0.c_str());
EXPECT_EQ(expected_output1, file_string1);
@@ -97,7 +97,7 @@
const vector<string> kPEMVector2{ kPEMData, "" };
FilePath outfile2 = certificate_file_.CreatePEMFromStrings(kPEMVector2);
EXPECT_TRUE(outfile2.empty());
- EXPECT_TRUE(file_util::PathExists(outfile1));
+ EXPECT_TRUE(base::PathExists(outfile1));
}
TEST_F(CertificateFileTest, ExtractHexData) {
@@ -124,10 +124,10 @@
CertificateFile certificate_file;
certificate_file.set_root_directory(temp_dir_.path());
outfile = certificate_file.CreatePEMFromStrings(vector<string>{ kPEMData });
- EXPECT_TRUE(file_util::PathExists(outfile));
+ EXPECT_TRUE(base::PathExists(outfile));
}
// The output file should be deleted when certificate_file goes out-of-scope.
- EXPECT_FALSE(file_util::PathExists(outfile));
+ EXPECT_FALSE(base::PathExists(outfile));
}
} // namespace shill
diff --git a/connection_info_reader.cc b/connection_info_reader.cc
index 054f57d..00872ab 100644
--- a/connection_info_reader.cc
+++ b/connection_info_reader.cc
@@ -8,9 +8,9 @@
#include <limits>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
#include "shill/file_reader.h"
#include "shill/logging.h"
diff --git a/connection_info_reader.h b/connection_info_reader.h
index a82b29b..5cb75bc 100644
--- a/connection_info_reader.h
+++ b/connection_info_reader.h
@@ -9,7 +9,7 @@
#include <vector>
#include <base/basictypes.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <gtest/gtest_prod.h>
#include "shill/connection_info.h"
diff --git a/connection_info_reader_unittest.cc b/connection_info_reader_unittest.cc
index 7098444..8c19493 100644
--- a/connection_info_reader_unittest.cc
+++ b/connection_info_reader_unittest.cc
@@ -8,8 +8,8 @@
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
-#include <base/stringprintf.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -60,7 +60,7 @@
void CreateConnectionInfoFile(const char **lines, size_t num_lines,
const FilePath &dir_path, FilePath *file_path) {
- ASSERT_TRUE(file_util::CreateTemporaryFileInDir(dir_path, file_path));
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(dir_path, file_path));
for (size_t i = 0; i < num_lines; ++i) {
string line = lines[i];
line += '\n';
diff --git a/crypto_des_cbc.cc b/crypto_des_cbc.cc
index 6dd09fb..1619982 100644
--- a/crypto_des_cbc.cc
+++ b/crypto_des_cbc.cc
@@ -7,7 +7,7 @@
#include <rpc/des_crypt.h>
#include <base/file_util.h>
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include "shill/glib.h"
@@ -87,7 +87,7 @@
string matter;
// TODO(petkov): This mimics current flimflam behavior. Fix it so that it
// doesn't read the whole file.
- if (!file_util::ReadFileToString(path, &matter)) {
+ if (!base::ReadFileToString(path, &matter)) {
LOG(ERROR) << "Unable to load key matter from " << path.value();
return false;
}
diff --git a/crypto_provider.cc b/crypto_provider.cc
index 9273334..8d5c157 100644
--- a/crypto_provider.cc
+++ b/crypto_provider.cc
@@ -5,7 +5,7 @@
#include "shill/crypto_provider.h"
#include <base/memory/scoped_ptr.h>
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include "shill/crypto_des_cbc.h"
#include "shill/crypto_rot47.h"
diff --git a/crypto_provider.h b/crypto_provider.h
index 2930d07..dd51316 100644
--- a/crypto_provider.h
+++ b/crypto_provider.h
@@ -5,7 +5,7 @@
#ifndef SHILL_CRYPTO_PROVIDER_
#define SHILL_CRYPTO_PROVIDER_
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/scoped_vector.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
diff --git a/crypto_util_proxy.cc b/crypto_util_proxy.cc
index a199280..46d594b 100644
--- a/crypto_util_proxy.cc
+++ b/crypto_util_proxy.cc
@@ -9,8 +9,8 @@
#include <vector>
#include <base/posix/eintr_wrapper.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include "shill/event_dispatcher.h"
#include "shill/file_io.h"
diff --git a/crypto_util_proxy.h b/crypto_util_proxy.h
index 7915b5b..875734b 100644
--- a/crypto_util_proxy.h
+++ b/crypto_util_proxy.h
@@ -11,7 +11,7 @@
#include <base/basictypes.h>
#include <base/cancelable_callback.h>
#include <base/memory/weak_ptr.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
#include "shill/callbacks.h"
diff --git a/default_profile.cc b/default_profile.cc
index 7987c11..16816f0 100644
--- a/default_profile.cc
+++ b/default_profile.cc
@@ -6,9 +6,9 @@
#include <vector>
-#include <base/file_path.h>
-#include <base/string_number_conversions.h>
-#include <base/stringprintf.h>
+#include <base/files/file_path.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/adaptor_interfaces.h"
diff --git a/default_profile.h b/default_profile.h
index 46f91cb..c7e7b79 100644
--- a/default_profile.h
+++ b/default_profile.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/scoped_ptr.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
diff --git a/default_profile_unittest.cc b/default_profile_unittest.cc
index edbcfed..90d6191 100644
--- a/default_profile_unittest.cc
+++ b/default_profile_unittest.cc
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <chromeos/dbus/service_constants.h>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
diff --git a/device.cc b/device.cc
index 23b7534..0b48b7b 100644
--- a/device.cc
+++ b/device.cc
@@ -15,7 +15,7 @@
#include <base/bind.h>
#include <base/file_util.h>
#include <base/memory/ref_counted.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/async_connection.h"
diff --git a/device_info.cc b/device_info.cc
index 434ee86..a02c103 100644
--- a/device_info.cc
+++ b/device_info.cc
@@ -22,11 +22,12 @@
#include <base/bind.h>
#include <base/file_util.h>
+#include <base/files/file_enumerator.h>
#include <base/memory/scoped_ptr.h>
#include <base/stl_util.h>
-#include <base/string_number_conversions.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include "shill/control_interface.h"
#include "shill/device.h"
@@ -48,6 +49,7 @@
#include "shill/wifi.h"
using base::Bind;
+using base::FileEnumerator;
using base::FilePath;
using base::StringPrintf;
using base::Unretained;
@@ -93,8 +95,6 @@
manager_(manager),
link_callback_(Bind(&DeviceInfo::LinkMsgHandler, Unretained(this))),
address_callback_(Bind(&DeviceInfo::AddressMsgHandler, Unretained(this))),
- link_listener_(NULL),
- address_listener_(NULL),
device_info_root_(kDeviceInfoRoot),
routing_table_(RoutingTable::GetInstance()),
rtnl_handler_(RTNLHandler::GetInstance()),
@@ -201,14 +201,14 @@
bool DeviceInfo::GetDeviceInfoContents(const string &iface_name,
const string &path_name,
string *contents_out) {
- return file_util::ReadFileToString(GetDeviceInfoPath(iface_name, path_name),
- contents_out);
+ return base::ReadFileToString(GetDeviceInfoPath(iface_name, path_name),
+ contents_out);
}
bool DeviceInfo::GetDeviceInfoSymbolicLink(const string &iface_name,
const string &path_name,
FilePath *path_out) {
- return file_util::ReadSymbolicLink(GetDeviceInfoPath(iface_name, path_name),
- path_out);
+ return base::ReadSymbolicLink(GetDeviceInfoPath(iface_name, path_name),
+ path_out);
}
Technology::Identifier DeviceInfo::GetDeviceTechnology(
@@ -216,7 +216,7 @@
string type_string;
int arp_type = ARPHRD_VOID;
if (GetDeviceInfoContents(iface_name, kInterfaceType, &type_string) &&
- TrimString(type_string, "\n", &type_string) &&
+ base::TrimString(type_string, "\n", &type_string) &&
!base::StringToInt(type_string, &arp_type)) {
arp_type = ARPHRD_VOID;
}
@@ -276,7 +276,7 @@
string tun_flags_str;
int tun_flags = 0;
if (GetDeviceInfoContents(iface_name, kInterfaceTunFlags, &tun_flags_str) &&
- TrimString(tun_flags_str, "\n", &tun_flags_str) &&
+ base::TrimString(tun_flags_str, "\n", &tun_flags_str) &&
base::HexStringToInt(tun_flags_str, &tun_flags) &&
(tun_flags & IFF_TUN)) {
SLOG(Device, 2) << StringPrintf("%s: device %s is tun device",
@@ -361,14 +361,14 @@
FilePath device_file = GetDeviceInfoPath(iface_name, kInterfaceDevice);
FilePath device_path;
- if (!file_util::ReadSymbolicLink(device_file, &device_path)) {
+ if (!base::ReadSymbolicLink(device_file, &device_path)) {
SLOG(Device, 2) << StringPrintf("%s: device %s has no device symlink",
__func__, iface_name.c_str());
return false;
}
if (!device_path.IsAbsolute()) {
- device_path = device_file.DirName().Append(device_path);
- file_util::AbsolutePath(&device_path);
+ device_path =
+ base::MakeAbsoluteFilePath(device_file.DirName().Append(device_path));
}
// Look for tty interface by enumerating all directories under the parent
@@ -381,11 +381,9 @@
// static
bool DeviceInfo::HasSubdir(const FilePath &base_dir, const FilePath &subdir) {
- file_util::FileEnumerator::FileType type =
- static_cast<file_util::FileEnumerator::FileType>(
- file_util::FileEnumerator::DIRECTORIES |
- file_util::FileEnumerator::SHOW_SYM_LINKS);
- file_util::FileEnumerator dir_enum(base_dir, true, type);
+ FileEnumerator::FileType type = static_cast<FileEnumerator::FileType>(
+ FileEnumerator::DIRECTORIES | FileEnumerator::SHOW_SYM_LINKS);
+ FileEnumerator dir_enum(base_dir, true, type);
for (FilePath curr_dir = dir_enum.Next(); !curr_dir.empty();
curr_dir = dir_enum.Next()) {
if (curr_dir.BaseName() == subdir)
diff --git a/device_info.h b/device_info.h
index 4539dd3..29dca2e 100644
--- a/device_info.h
+++ b/device_info.h
@@ -12,7 +12,7 @@
#include <base/callback.h>
#include <base/cancelable_callback.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/ref_counted.h>
#include <base/memory/scoped_ptr.h>
#include <base/memory/weak_ptr.h>
diff --git a/device_info_unittest.cc b/device_info_unittest.cc
index 64149f8..f058c08 100644
--- a/device_info_unittest.cc
+++ b/device_info_unittest.cc
@@ -17,9 +17,9 @@
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
#include <base/memory/ref_counted.h>
-#include <base/message_loop.h>
+#include <base/message_loop/message_loop.h>
#include <base/stl_util.h>
-#include <base/string_number_conversions.h>
+#include <base/strings/string_number_conversions.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -852,12 +852,12 @@
TEST_F(DeviceInfoTest, HasSubdir) {
base::ScopedTempDir temp_dir;
EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
- EXPECT_TRUE(file_util::CreateDirectory(temp_dir.path().Append("child1")));
+ EXPECT_TRUE(base::CreateDirectory(temp_dir.path().Append("child1")));
FilePath child2 = temp_dir.path().Append("child2");
- EXPECT_TRUE(file_util::CreateDirectory(child2));
+ EXPECT_TRUE(base::CreateDirectory(child2));
FilePath grandchild = child2.Append("grandchild");
- EXPECT_TRUE(file_util::CreateDirectory(grandchild));
- EXPECT_TRUE(file_util::CreateDirectory(grandchild.Append("greatgrandchild")));
+ EXPECT_TRUE(base::CreateDirectory(grandchild));
+ EXPECT_TRUE(base::CreateDirectory(grandchild.Append("greatgrandchild")));
EXPECT_TRUE(DeviceInfo::HasSubdir(temp_dir.path(),
FilePath("grandchild")));
EXPECT_TRUE(DeviceInfo::HasSubdir(temp_dir.path(),
@@ -1108,7 +1108,7 @@
void DeviceInfoTechnologyTest::CreateInfoFile(const string &name,
const string &contents) {
FilePath info_path = GetInfoPath(name);
- EXPECT_TRUE(file_util::CreateDirectory(info_path.DirName()));
+ EXPECT_TRUE(base::CreateDirectory(info_path.DirName()));
string contents_newline(contents + "\n");
EXPECT_TRUE(file_util::WriteFile(info_path, contents_newline.c_str(),
contents_newline.size()));
@@ -1117,14 +1117,14 @@
void DeviceInfoTechnologyTest::CreateInfoSymLink(const string &name,
const string &contents) {
FilePath info_path = GetInfoPath(name);
- EXPECT_TRUE(file_util::CreateDirectory(info_path.DirName()));
- EXPECT_TRUE(file_util::CreateSymbolicLink(FilePath(contents), info_path));
+ EXPECT_TRUE(base::CreateDirectory(info_path.DirName()));
+ EXPECT_TRUE(base::CreateSymbolicLink(FilePath(contents), info_path));
}
TEST_F(DeviceInfoTechnologyTest, Unknown) {
EXPECT_EQ(Technology::kUnknown, GetDeviceTechnology());
// Should still be unknown even without a uevent file.
- EXPECT_TRUE(file_util::Delete(GetInfoPath("uevent"), false));
+ EXPECT_TRUE(base::DeleteFile(GetInfoPath("uevent"), false));
EXPECT_EQ(Technology::kUnknown, GetDeviceTechnology());
}
@@ -1195,16 +1195,16 @@
FilePath device_root(temp_dir_.path().Append("sys/devices/virtual/0"));
FilePath device_path(device_root.Append("00"));
FilePath driver_symlink(device_path.Append("driver"));
- EXPECT_TRUE(file_util::CreateDirectory(device_path));
+ EXPECT_TRUE(base::CreateDirectory(device_path));
CreateInfoSymLink("device", device_path.value());
- EXPECT_TRUE(file_util::CreateSymbolicLink(FilePath("/drivers/cdc_ether"),
- driver_symlink));
- EXPECT_TRUE(file_util::CreateDirectory(device_root.Append("01/tty")));
+ EXPECT_TRUE(base::CreateSymbolicLink(FilePath("/drivers/cdc_ether"),
+ driver_symlink));
+ EXPECT_TRUE(base::CreateDirectory(device_root.Append("01/tty")));
EXPECT_EQ(Technology::kCellular, GetDeviceTechnology());
- EXPECT_TRUE(file_util::Delete(driver_symlink, false));
- EXPECT_TRUE(file_util::CreateSymbolicLink(FilePath("/drivers/cdc_ncm"),
- driver_symlink));
+ EXPECT_TRUE(base::DeleteFile(driver_symlink, false));
+ EXPECT_TRUE(base::CreateSymbolicLink(FilePath("/drivers/cdc_ncm"),
+ driver_symlink));
EXPECT_EQ(Technology::kCellular, GetDeviceTechnology());
}
@@ -1217,15 +1217,15 @@
FilePath device_root(temp_dir_.path().Append("sys/device_dir/0"));
FilePath device_path(device_root.Append("00"));
FilePath driver_symlink(device_path.Append("driver"));
- EXPECT_TRUE(file_util::CreateDirectory(device_path));
- EXPECT_TRUE(file_util::CreateSymbolicLink(FilePath("/drivers/cdc_ether"),
- driver_symlink));
- EXPECT_TRUE(file_util::CreateDirectory(device_root.Append("01/tty")));
+ EXPECT_TRUE(base::CreateDirectory(device_path));
+ EXPECT_TRUE(base::CreateSymbolicLink(FilePath("/drivers/cdc_ether"),
+ driver_symlink));
+ EXPECT_TRUE(base::CreateDirectory(device_root.Append("01/tty")));
EXPECT_EQ(Technology::kCellular, GetDeviceTechnology());
- EXPECT_TRUE(file_util::Delete(driver_symlink, false));
- EXPECT_TRUE(file_util::CreateSymbolicLink(FilePath("/drivers/cdc_ncm"),
- driver_symlink));
+ EXPECT_TRUE(base::DeleteFile(driver_symlink, false));
+ EXPECT_TRUE(base::CreateSymbolicLink(FilePath("/drivers/cdc_ncm"),
+ driver_symlink));
EXPECT_EQ(Technology::kCellular, GetDeviceTechnology());
}
@@ -1238,15 +1238,15 @@
FilePath device_root(temp_dir_.path().Append("sys/device_dir/0"));
FilePath device_path(device_root.Append("00"));
FilePath driver_symlink(device_path.Append("driver"));
- EXPECT_TRUE(file_util::CreateDirectory(device_path));
- EXPECT_TRUE(file_util::CreateSymbolicLink(FilePath("/drivers/cdc_ether"),
- driver_symlink));
- EXPECT_TRUE(file_util::CreateDirectory(device_root.Append("01/yyy/tty")));
+ EXPECT_TRUE(base::CreateDirectory(device_path));
+ EXPECT_TRUE(base::CreateSymbolicLink(FilePath("/drivers/cdc_ether"),
+ driver_symlink));
+ EXPECT_TRUE(base::CreateDirectory(device_root.Append("01/yyy/tty")));
EXPECT_EQ(Technology::kCellular, GetDeviceTechnology());
- EXPECT_TRUE(file_util::Delete(driver_symlink, false));
- EXPECT_TRUE(file_util::CreateSymbolicLink(FilePath("/drivers/cdc_ncm"),
- driver_symlink));
+ EXPECT_TRUE(base::DeleteFile(driver_symlink, false));
+ EXPECT_TRUE(base::CreateSymbolicLink(FilePath("/drivers/cdc_ncm"),
+ driver_symlink));
EXPECT_EQ(Technology::kCellular, GetDeviceTechnology());
}
diff --git a/dhcp_config.cc b/dhcp_config.cc
index 7c1a25a..baf74a3 100644
--- a/dhcp_config.cc
+++ b/dhcp_config.cc
@@ -9,8 +9,8 @@
#include <sys/wait.h>
#include <base/file_util.h>
-#include <base/string_split.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_split.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/dhcpcd_proxy.h"
@@ -491,11 +491,11 @@
proxy_.reset();
if (lease_file_suffix_ == device_name()) {
// If the lease file suffix was left as default, clean it up at exit.
- file_util::Delete(root_.Append(
+ base::DeleteFile(root_.Append(
base::StringPrintf(DHCPProvider::kDHCPCDPathFormatLease,
device_name().c_str())), false);
}
- file_util::Delete(root_.Append(
+ base::DeleteFile(root_.Append(
base::StringPrintf(kDHCPCDPathFormatPID, device_name().c_str())), false);
if (pid_) {
int pid = pid_;
diff --git a/dhcp_config.h b/dhcp_config.h
index 940664a..a37e3b2 100644
--- a/dhcp_config.h
+++ b/dhcp_config.h
@@ -6,7 +6,7 @@
#define SHILL_DHCP_CONFIG_
#include <base/cancelable_callback.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/scoped_ptr.h>
#include <base/memory/weak_ptr.h>
#include <dbus-c++/types.h>
diff --git a/dhcp_config_unittest.cc b/dhcp_config_unittest.cc
index cd37627..c449ae3 100644
--- a/dhcp_config_unittest.cc
+++ b/dhcp_config_unittest.cc
@@ -7,7 +7,7 @@
#include <base/bind.h>
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/dbus_adaptor.h"
@@ -146,16 +146,16 @@
EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
config->root_ = temp_dir_.path();
FilePath varrun = temp_dir_.path().Append("var/run/dhcpcd");
- EXPECT_TRUE(file_util::CreateDirectory(varrun));
+ EXPECT_TRUE(base::CreateDirectory(varrun));
pid_file_ = varrun.Append(base::StringPrintf("dhcpcd-%s.pid", kDeviceName));
FilePath varlib = temp_dir_.path().Append("var/lib/dhcpcd");
- EXPECT_TRUE(file_util::CreateDirectory(varlib));
+ EXPECT_TRUE(base::CreateDirectory(varlib));
lease_file_ =
varlib.Append(base::StringPrintf("dhcpcd-%s.lease", kDeviceName));
EXPECT_EQ(0, file_util::WriteFile(pid_file_, "", 0));
EXPECT_EQ(0, file_util::WriteFile(lease_file_, "", 0));
- EXPECT_TRUE(file_util::PathExists(pid_file_));
- EXPECT_TRUE(file_util::PathExists(lease_file_));
+ EXPECT_TRUE(base::PathExists(pid_file_));
+ EXPECT_TRUE(base::PathExists(lease_file_));
return config;
}
@@ -168,8 +168,8 @@
DHCPConfig::ChildWatchCallback(kPID, 10, config.get());
EXPECT_EQ(NULL, DHCPProvider::GetInstance()->GetConfig(kPID).get());
- EXPECT_FALSE(file_util::PathExists(pid_file_));
- EXPECT_EQ(lease_file_exists, file_util::PathExists(lease_file_));
+ EXPECT_FALSE(base::PathExists(pid_file_));
+ EXPECT_EQ(lease_file_exists, base::PathExists(lease_file_));
}
TEST_F(DHCPConfigTest, GetIPv4AddressString) {
diff --git a/dhcp_provider.cc b/dhcp_provider.cc
index 7a9cf96..f92d585 100644
--- a/dhcp_provider.cc
+++ b/dhcp_provider.cc
@@ -5,7 +5,7 @@
#include "shill/dhcp_provider.h"
#include <base/file_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/control_interface.h"
#include "shill/dhcp_config.h"
@@ -90,7 +90,7 @@
void DHCPProvider::DestroyLease(const string &name) {
SLOG(DHCP, 2) << __func__ << " name: " << name;
- file_util::Delete(root_.Append(
+ base::DeleteFile(root_.Append(
base::StringPrintf(kDHCPCDPathFormatLease,
name.c_str())), false);
}
diff --git a/dhcp_provider.h b/dhcp_provider.h
index da9c46e..aea0c68 100644
--- a/dhcp_provider.h
+++ b/dhcp_provider.h
@@ -8,7 +8,7 @@
#include <map>
#include <string>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/lazy_instance.h>
#include <base/memory/scoped_ptr.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
diff --git a/dhcp_provider_unittest.cc b/dhcp_provider_unittest.cc
index 87353d0..efa5984 100644
--- a/dhcp_provider_unittest.cc
+++ b/dhcp_provider_unittest.cc
@@ -6,7 +6,7 @@
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/dhcp_config.h"
#include "shill/mock_control.h"
@@ -63,11 +63,11 @@
lease_file = provider_->root_.Append(base::StringPrintf(
DHCPProvider::kDHCPCDPathFormatLease,
kDeviceName));
- EXPECT_TRUE(file_util::CreateDirectory(lease_file.DirName()));
+ EXPECT_TRUE(base::CreateDirectory(lease_file.DirName()));
EXPECT_EQ(0, file_util::WriteFile(lease_file, "", 0));
- EXPECT_TRUE(file_util::PathExists(lease_file));
+ EXPECT_TRUE(base::PathExists(lease_file));
provider_->DestroyLease(kDeviceName);
- EXPECT_FALSE(file_util::PathExists(lease_file));
+ EXPECT_FALSE(base::PathExists(lease_file));
}
} // namespace shill
diff --git a/diagnostics_reporter.cc b/diagnostics_reporter.cc
index 34b6ead..9c7941e 100644
--- a/diagnostics_reporter.cc
+++ b/diagnostics_reporter.cc
@@ -55,7 +55,7 @@
last_log_stash_ = now.tv_sec;
// Delete logs possibly stashed by a different user.
- file_util::Delete(stashed_net_log_, false);
+ base::DeleteFile(stashed_net_log_, false);
LOG(INFO) << "Spawning " << kNetDiagsUpload << " @ " << last_log_stash_;
vector<char *> args;
diff --git a/diagnostics_reporter.h b/diagnostics_reporter.h
index 9d80add..11c294e 100644
--- a/diagnostics_reporter.h
+++ b/diagnostics_reporter.h
@@ -5,7 +5,7 @@
#ifndef SHILL_DIAGNOSTICS_REPORTER_H_
#define SHILL_DIAGNOSTICS_REPORTER_H_
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/lazy_instance.h>
namespace shill {
diff --git a/diagnostics_reporter_unittest.cc b/diagnostics_reporter_unittest.cc
index ad5fb0e..841b0ae 100644
--- a/diagnostics_reporter_unittest.cc
+++ b/diagnostics_reporter_unittest.cc
@@ -103,7 +103,7 @@
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
FilePath stashed_net_log = temp_dir_.path().Append("stashed-net-log");
EXPECT_EQ(0, file_util::WriteFile(stashed_net_log, "", 0));
- EXPECT_TRUE(file_util::PathExists(stashed_net_log));
+ EXPECT_TRUE(base::PathExists(stashed_net_log));
SetStashedNetLog(stashed_net_log);
EXPECT_CALL(time_, GetTimeMonotonic(_))
.WillOnce(DoAll(SetArgumentPointee<0>(now0), Return(0)))
@@ -127,7 +127,7 @@
EXPECT_CALL(process_killer_, Wait(kPID, _)).Times(1);
reporter_.OnConnectivityEvent();
EXPECT_EQ(kNow0, GetLastLogStash());
- EXPECT_FALSE(file_util::PathExists(stashed_net_log));
+ EXPECT_FALSE(base::PathExists(stashed_net_log));
reporter_.OnConnectivityEvent();
EXPECT_EQ(kNow1, GetLastLogStash());
}
diff --git a/dns_client.cc b/dns_client.cc
index 461b6a5..e3ae826 100644
--- a/dns_client.cc
+++ b/dns_client.cc
@@ -18,7 +18,7 @@
#include <base/bind.h>
#include <base/bind_helpers.h>
#include <base/stl_util.h>
-#include <base/string_number_conversions.h>
+#include <base/strings/string_number_conversions.h>
#include "shill/logging.h"
#include "shill/shill_ares.h"
@@ -67,7 +67,6 @@
callback_(callback),
timeout_ms_(timeout_ms),
running_(false),
- resolver_state_(NULL),
weak_ptr_factory_(this),
ares_(Ares::GetInstance()),
time_(Time::GetInstance()) {}
diff --git a/eap_credentials.h b/eap_credentials.h
index afacd44..3193968 100644
--- a/eap_credentials.h
+++ b/eap_credentials.h
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <dbus-c++/dbus.h>
#include "shill/technology.h"
diff --git a/ethernet_eap_service.cc b/ethernet_eap_service.cc
index 08f418b..0f4a059 100644
--- a/ethernet_eap_service.cc
+++ b/ethernet_eap_service.cc
@@ -6,7 +6,7 @@
#include <string>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/eap_credentials.h"
#include "shill/ethernet_eap_provider.h"
@@ -30,8 +30,8 @@
EthernetEapService::~EthernetEapService() {}
string EthernetEapService::GetStorageIdentifier() const {
- return StringPrintf("%s_all",
- Technology::NameFromIdentifier(technology()).c_str());
+ return base::StringPrintf(
+ "%s_all", Technology::NameFromIdentifier(technology()).c_str());
}
string EthernetEapService::GetDeviceRpcId(Error */*error*/) const {
diff --git a/ethernet_service.cc b/ethernet_service.cc
index 36e626f..4230690 100644
--- a/ethernet_service.cc
+++ b/ethernet_service.cc
@@ -11,7 +11,7 @@
#include <string>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/control_interface.h"
diff --git a/event_dispatcher.cc b/event_dispatcher.cc
index f2ca4b6..bdbb490 100644
--- a/event_dispatcher.cc
+++ b/event_dispatcher.cc
@@ -9,9 +9,9 @@
#include <base/callback.h>
#include <base/location.h>
-#include <base/message_loop_proxy.h>
+#include <base/message_loop/message_loop_proxy.h>
#include <base/run_loop.h>
-#include <base/time.h>
+#include <base/time/time.h>
#include "shill/glib_io_input_handler.h"
#include "shill/glib_io_ready_handler.h"
@@ -22,14 +22,14 @@
namespace shill {
EventDispatcher::EventDispatcher()
- : dont_use_directly_(new MessageLoopForUI),
+ : dont_use_directly_(new base::MessageLoopForUI),
message_loop_proxy_(base::MessageLoopProxy::current()) {
}
EventDispatcher::~EventDispatcher() {}
void EventDispatcher::DispatchForever() {
- MessageLoop::current()->Run();
+ base::MessageLoop::current()->Run();
}
void EventDispatcher::DispatchPendingEvents() {
diff --git a/event_dispatcher.h b/event_dispatcher.h
index ef5121e..b620665 100644
--- a/event_dispatcher.h
+++ b/event_dispatcher.h
@@ -9,7 +9,7 @@
#include <base/callback.h>
#include <base/memory/ref_counted.h>
#include <base/memory/scoped_ptr.h>
-#include <base/message_loop.h>
+#include <base/message_loop/message_loop.h>
#include "shill/io_handler.h"
@@ -49,7 +49,7 @@
const IOHandler::ReadyCallback &ready_callback);
private:
- scoped_ptr<MessageLoop> dont_use_directly_;
+ scoped_ptr<base::MessageLoop> dont_use_directly_;
scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
DISALLOW_COPY_AND_ASSIGN(EventDispatcher);
diff --git a/external_task.h b/external_task.h
index 2e871db..e9c5126 100644
--- a/external_task.h
+++ b/external_task.h
@@ -12,7 +12,7 @@
#include <vector>
#include <base/callback.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/scoped_ptr.h>
#include <base/memory/weak_ptr.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
diff --git a/external_task_unittest.cc b/external_task_unittest.cc
index 4994cdd..e973e86 100644
--- a/external_task_unittest.cc
+++ b/external_task_unittest.cc
@@ -10,9 +10,9 @@
#include <vector>
#include <base/bind.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/weak_ptr.h>
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/file_reader.cc b/file_reader.cc
index f670964..d0021a4 100644
--- a/file_reader.cc
+++ b/file_reader.cc
@@ -20,7 +20,7 @@
}
bool FileReader::Open(const FilePath &file_path) {
- file_.reset(file_util::OpenFile(file_path, "rb"));
+ file_.reset(base::OpenFile(file_path, "rb"));
return file_.get() != NULL;
}
diff --git a/file_reader.h b/file_reader.h
index f73b6cc..3d7e452 100644
--- a/file_reader.h
+++ b/file_reader.h
@@ -8,7 +8,7 @@
#include <string>
#include <base/basictypes.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
namespace shill {
diff --git a/file_reader_unittest.cc b/file_reader_unittest.cc
index f87aacf..ca12ae6 100644
--- a/file_reader_unittest.cc
+++ b/file_reader_unittest.cc
@@ -9,7 +9,7 @@
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include <gtest/gtest.h>
using base::FilePath;
@@ -45,7 +45,7 @@
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
FilePath path;
- ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir.path(), &path));
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &path));
EXPECT_TRUE(reader_.Open(path));
string line;
@@ -64,7 +64,7 @@
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
FilePath path;
- ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir.path(), &path));
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &path));
// Test a file not ending with a new-line character
ASSERT_EQ(content.size(),
diff --git a/generic_netlink_message.cc b/generic_netlink_message.cc
index 4e8adc7..793ff64 100644
--- a/generic_netlink_message.cc
+++ b/generic_netlink_message.cc
@@ -8,7 +8,7 @@
#include <netlink/netlink.h>
#include <base/bind.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/logging.h"
#include "shill/netlink_attribute.h"
diff --git a/glib.cc b/glib.cc
index c73374c..49d5472 100644
--- a/glib.cc
+++ b/glib.cc
@@ -6,7 +6,7 @@
#include <string>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/logging.h"
diff --git a/glib_io_input_handler.cc b/glib_io_input_handler.cc
index 3052839..df0770c 100644
--- a/glib_io_input_handler.cc
+++ b/glib_io_input_handler.cc
@@ -12,8 +12,8 @@
#include <string>
#include <vector>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include "shill/error.h"
#include "shill/logging.h"
diff --git a/hook_table_unittest.cc b/hook_table_unittest.cc
index 0b60970..bc280f7 100644
--- a/hook_table_unittest.cc
+++ b/hook_table_unittest.cc
@@ -8,15 +8,15 @@
#include <base/bind.h>
#include <base/callback.h>
-#include <base/message_loop.h>
+#include <base/message_loop/message_loop.h>
#include "shill/error.h"
#include "shill/event_dispatcher.h"
#include "shill/testing.h"
+using base::Bind;
using base::Callback;
using base::Closure;
-using base::Bind;
using base::Unretained;
using std::string;
using ::testing::_;
@@ -37,7 +37,7 @@
HookTableTest()
: hook_table_(&event_dispatcher_) {}
- base::Callback<void(const Error &)> *GetDoneCallback() {
+ Callback<void(const Error &)> *GetDoneCallback() {
return &hook_table_.done_cb_;
}
@@ -95,7 +95,7 @@
hook_table_.Run(kTimeout, done_cb);
// Cause the event dispatcher to exit after kTimeout + 1 ms.
- event_dispatcher_.PostDelayedTask(MessageLoop::QuitClosure(),
+ event_dispatcher_.PostDelayedTask(base::MessageLoop::QuitClosure(),
kTimeout + 1);
event_dispatcher_.DispatchForever();
EXPECT_TRUE(GetDoneCallback()->is_null());
@@ -147,7 +147,7 @@
hook_table_.ActionComplete(kName1);
hook_table_.ActionComplete(kName3);
// Cause the event dispatcher to exit after kTimeout + 1 ms.
- event_dispatcher_.PostDelayedTask(MessageLoop::QuitClosure(),
+ event_dispatcher_.PostDelayedTask(base::MessageLoop::QuitClosure(),
kTimeout + 1);
event_dispatcher_.DispatchForever();
}
diff --git a/http_proxy.cc b/http_proxy.cc
index c568098..238a679 100644
--- a/http_proxy.cc
+++ b/http_proxy.cc
@@ -14,10 +14,10 @@
#include <vector>
#include <base/bind.h>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include "shill/async_connection.h"
#include "shill/connection.h"
@@ -70,10 +70,8 @@
write_server_callback_(Bind(&HTTPProxy::WriteToServer,
weak_ptr_factory_.GetWeakPtr())),
dispatcher_(NULL),
- dns_client_(NULL),
proxy_port_(-1),
proxy_socket_(-1),
- server_async_connection_(NULL),
sockets_(NULL),
client_socket_(-1),
server_port_(kDefaultServerPort),
@@ -328,7 +326,7 @@
// error occurs.
bool HTTPProxy::ProcessLastHeaderLine() {
string *header = &client_headers_.back();
- TrimString(*header, "\r", header);
+ base::TrimString(*header, "\r", header);
if (header->empty()) {
// Empty line terminates client headers.
diff --git a/http_proxy_unittest.cc b/http_proxy_unittest.cc
index 71e3509..f378652 100644
--- a/http_proxy_unittest.cc
+++ b/http_proxy_unittest.cc
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gtest/gtest.h>
#include "shill/ip_address.h"
diff --git a/http_request.cc b/http_request.cc
index 2ece2fa..9bc6f58 100644
--- a/http_request.cc
+++ b/http_request.cc
@@ -7,8 +7,8 @@
#include <string>
#include <base/bind.h>
-#include <base/string_number_conversions.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/stringprintf.h>
#include "shill/async_connection.h"
#include "shill/connection.h"
diff --git a/http_request_unittest.cc b/http_request_unittest.cc
index 30a4b77..87a4141 100644
--- a/http_request_unittest.cc
+++ b/http_request_unittest.cc
@@ -10,7 +10,7 @@
#include <vector>
#include <base/bind.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gtest/gtest.h>
#include "shill/ip_address.h"
diff --git a/http_url.cc b/http_url.cc
index c1836cb..5a6b2b4 100644
--- a/http_url.cc
+++ b/http_url.cc
@@ -7,8 +7,8 @@
#include <string>
#include <vector>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
using std::string;
using std::vector;
diff --git a/ip_address.cc b/ip_address.cc
index 6e8fce6..715b81e 100644
--- a/ip_address.cc
+++ b/ip_address.cc
@@ -10,8 +10,8 @@
#include <string>
#include <vector>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
#include "shill/byte_string.h"
#include "shill/logging.h"
diff --git a/ipconfig_dbus_adaptor.cc b/ipconfig_dbus_adaptor.cc
index c248065..7162e60 100644
--- a/ipconfig_dbus_adaptor.cc
+++ b/ipconfig_dbus_adaptor.cc
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <dbus-c++/dbus.h>
#include "shill/error.h"
diff --git a/key_file_store.cc b/key_file_store.cc
index 12a5f0a..cfcd487 100644
--- a/key_file_store.cc
+++ b/key_file_store.cc
@@ -8,7 +8,7 @@
#include <base/files/important_file_writer.h>
#include <base/file_util.h>
-#include <base/string_number_conversions.h>
+#include <base/strings/string_number_conversions.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -45,7 +45,7 @@
bool KeyFileStore::IsNonEmpty() const {
int64 file_size = 0;
- return file_util::GetFileSize(path_, &file_size) && file_size != 0;
+ return base::GetFileSize(path_, &file_size) && file_size != 0;
}
bool KeyFileStore::Open() {
diff --git a/key_file_store.h b/key_file_store.h
index f3fd071..946d6ee 100644
--- a/key_file_store.h
+++ b/key_file_store.h
@@ -5,7 +5,7 @@
#ifndef SHILL_KEY_FILE_STORE_
#define SHILL_KEY_FILE_STORE_
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
#include "shill/crypto_provider.h"
diff --git a/key_file_store_unittest.cc b/key_file_store_unittest.cc
index 598543c..adbe603 100644
--- a/key_file_store_unittest.cc
+++ b/key_file_store_unittest.cc
@@ -5,28 +5,22 @@
#include "shill/key_file_store.h"
#include <base/file_util.h>
+#include <base/files/file_enumerator.h>
#include <base/files/scoped_temp_dir.h>
#include <base/stl_util.h>
-#include <base/string_number_conversions.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/stringprintf.h>
#include <gtest/gtest.h>
#include "shill/key_value_store.h"
+using base::FileEnumerator;
using base::FilePath;
-using file_util::FileEnumerator;
using std::set;
using std::string;
using std::vector;
using testing::Test;
-// TODO(benchan): Remove this workaround after finishing glib 2.32 migration.
-#ifdef GLIB_VERSION_2_32
-#define KEY_FILE_EXTRA_NEW_LINE
-#else
-#define KEY_FILE_EXTRA_NEW_LINE "\n"
-#endif
-
namespace shill {
namespace {
@@ -64,7 +58,7 @@
string KeyFileStoreTest::ReadKeyFile() {
string data;
- EXPECT_TRUE(file_util::ReadFileToString(store_.path(), &data));
+ EXPECT_TRUE(base::ReadFileToString(store_.path(), &data));
return data;
}
@@ -88,12 +82,11 @@
// Verify that the file actually got written with the right name.
EXPECT_EQ(test_file_.value(), file_enumerator.Next().value());
- FileEnumerator::FindInfo find_info;
- file_enumerator.GetFindInfo(&find_info);
+ FileEnumerator::FileInfo file_info = file_enumerator.GetInfo();
// Verify that the profile is a regular file, readable and writeable by the
// owner only.
- EXPECT_EQ(S_IFREG | S_IRUSR | S_IWUSR, find_info.stat.st_mode);
+ EXPECT_EQ(S_IFREG | S_IRUSR | S_IWUSR, file_info.stat().st_mode);
ASSERT_TRUE(store_.Open());
EXPECT_TRUE(store_.key_file_);
@@ -117,12 +110,11 @@
EXPECT_FALSE(store_.IsNonEmpty());
WriteKeyFile("garbage\n");
EXPECT_TRUE(store_.IsNonEmpty());
- EXPECT_TRUE(file_util::PathExists(store_.path()));
+ EXPECT_TRUE(base::PathExists(store_.path()));
EXPECT_TRUE(store_.MarkAsCorrupted());
EXPECT_FALSE(store_.IsNonEmpty());
- EXPECT_FALSE(file_util::PathExists(store_.path()));
- EXPECT_TRUE(
- file_util::PathExists(FilePath(store_.path().value() + ".corrupted")));
+ EXPECT_FALSE(base::PathExists(store_.path()));
+ EXPECT_TRUE(base::PathExists(FilePath(store_.path().value() + ".corrupted")));
}
TEST_F(KeyFileStoreTest, GetGroups) {
@@ -287,8 +279,7 @@
EXPECT_TRUE(store_.DeleteKey(kGroup, "random-key"));
EXPECT_FALSE(store_.DeleteKey("random-group", kKeyAlive));
ASSERT_TRUE(store_.Close());
- EXPECT_EQ(base::StringPrintf(KEY_FILE_EXTRA_NEW_LINE
- "[%s]\n"
+ EXPECT_EQ(base::StringPrintf("[%s]\n"
"%s=%d\n",
kGroup, kKeyAlive, kValueAlive),
ReadKeyFile());
@@ -307,8 +298,7 @@
EXPECT_TRUE(store_.DeleteGroup(kGroupB));
EXPECT_TRUE(store_.DeleteGroup("group-d"));
ASSERT_TRUE(store_.Close());
- EXPECT_EQ(base::StringPrintf(KEY_FILE_EXTRA_NEW_LINE
- "[%s]\n"
+ EXPECT_EQ(base::StringPrintf("[%s]\n"
"\n"
"[%s]\n",
kGroupA, kGroupC),
@@ -342,8 +332,7 @@
ASSERT_TRUE(store_.SetString(kGroup, kKey1, kValue1));
ASSERT_TRUE(store_.SetString(kGroup, kKey2, kValue2));
ASSERT_TRUE(store_.Close());
- EXPECT_EQ(base::StringPrintf(KEY_FILE_EXTRA_NEW_LINE
- "[%s]\n"
+ EXPECT_EQ(base::StringPrintf("[%s]\n"
"%s=%s\n"
"%s=%s\n",
kGroup, kKey1, kValue1, kKey2, kValue2),
@@ -389,8 +378,7 @@
ASSERT_TRUE(store_.SetBool(kGroup, kKeyTrue, true));
ASSERT_TRUE(store_.SetBool(kGroup, kKeyFalse, false));
ASSERT_TRUE(store_.Close());
- EXPECT_EQ(base::StringPrintf(KEY_FILE_EXTRA_NEW_LINE
- "[%s]\n"
+ EXPECT_EQ(base::StringPrintf("[%s]\n"
"%s=true\n"
"%s=false\n",
kGroup, kKeyTrue, kKeyFalse),
@@ -444,8 +432,7 @@
ASSERT_TRUE(store_.SetInt(kGroup, kKey1, kValue1));
ASSERT_TRUE(store_.SetInt(kGroup, kKey2, kValue2));
ASSERT_TRUE(store_.Close());
- EXPECT_EQ(base::StringPrintf(KEY_FILE_EXTRA_NEW_LINE
- "[%s]\n"
+ EXPECT_EQ(base::StringPrintf("[%s]\n"
"%s=%d\n"
"%s=%d\n",
kGroup, kKey1, kValue1, kKey2, kValue2),
@@ -491,8 +478,7 @@
ASSERT_TRUE(store_.Open());
ASSERT_TRUE(store_.SetUint64(kGroup, kKey, kValue));
ASSERT_TRUE(store_.Close());
- EXPECT_EQ(base::StringPrintf(KEY_FILE_EXTRA_NEW_LINE
- "[%s]\n"
+ EXPECT_EQ(base::StringPrintf("[%s]\n"
"%s=%s\n",
kGroup, kKey,
base::Uint64ToString(kValue).c_str()),
@@ -598,8 +584,7 @@
ASSERT_TRUE(store_.SetStringList(kGroup, kKeyValues, value));
}
ASSERT_TRUE(store_.Close());
- EXPECT_EQ(base::StringPrintf(KEY_FILE_EXTRA_NEW_LINE
- "[%s]\n"
+ EXPECT_EQ(base::StringPrintf("[%s]\n"
"%s=\n"
"%s=;%s;\n"
"%s=%s;;\n"
@@ -636,8 +621,7 @@
ASSERT_TRUE(store_.Open());
ASSERT_TRUE(store_.SetCryptedString(kGroup, kKey, kPlainText));
ASSERT_TRUE(store_.Close());
- EXPECT_EQ(base::StringPrintf(KEY_FILE_EXTRA_NEW_LINE
- "[%s]\n"
+ EXPECT_EQ(base::StringPrintf("[%s]\n"
"%s=%s\n",
kGroup, kKey, kROT47Text),
ReadKeyFile());
@@ -856,8 +840,7 @@
}
ASSERT_TRUE(store_.Close());
- EXPECT_EQ(base::StringPrintf(KEY_FILE_EXTRA_NEW_LINE
- "[%s]\n"
+ EXPECT_EQ(base::StringPrintf("[%s]\n"
"%s=%s;\n"
"%s=%d\n"
"%s=false\n"
diff --git a/l2tp_ipsec_driver.cc b/l2tp_ipsec_driver.cc
index aecae98..2387f50 100644
--- a/l2tp_ipsec_driver.cc
+++ b/l2tp_ipsec_driver.cc
@@ -25,7 +25,7 @@
#include <base/bind.h>
#include <base/file_util.h>
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include <vpn-manager/service_error.h>
@@ -179,7 +179,7 @@
void L2TPIPSecDriver::DeleteTemporaryFile(base::FilePath *temporary_file) {
if (!temporary_file->empty()) {
- file_util::Delete(*temporary_file, false);
+ base::DeleteFile(*temporary_file, false);
temporary_file->clear();
}
}
@@ -272,11 +272,10 @@
bool L2TPIPSecDriver::InitPSKOptions(vector<string> *options, Error *error) {
string psk = args()->LookupString(kL2tpIpsecPskProperty, "");
if (!psk.empty()) {
- if (!file_util::CreateTemporaryFileInDir(
- manager()->run_path(), &psk_file_) ||
+ if (!base::CreateTemporaryFileInDir(manager()->run_path(), &psk_file_) ||
chmod(psk_file_.value().c_str(), S_IRUSR | S_IWUSR) ||
file_util::WriteFile(psk_file_, psk.data(), psk.size()) !=
- static_cast<int>(psk.size())) {
+ static_cast<int>(psk.size())) {
Error::PopulateAndLog(
error, Error::kInternalError, "Unable to setup psk file.");
return false;
@@ -335,11 +334,10 @@
return false;
}
string xauth_credentials = user + "\n" + password + "\n";
- if (!file_util::CreateTemporaryFileInDir(
- manager()->run_path(), &xauth_credentials_file_) ||
+ if (!base::CreateTemporaryFileInDir(manager()->run_path(),
+ &xauth_credentials_file_) ||
chmod(xauth_credentials_file_.value().c_str(), S_IRUSR | S_IWUSR) ||
- file_util::WriteFile(xauth_credentials_file_,
- xauth_credentials.data(),
+ file_util::WriteFile(xauth_credentials_file_, xauth_credentials.data(),
xauth_credentials.size()) !=
static_cast<int>(xauth_credentials.size())) {
Error::PopulateAndLog(
diff --git a/l2tp_ipsec_driver.h b/l2tp_ipsec_driver.h
index a2861ce..8a5874a 100644
--- a/l2tp_ipsec_driver.h
+++ b/l2tp_ipsec_driver.h
@@ -9,7 +9,7 @@
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/scoped_ptr.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
diff --git a/l2tp_ipsec_driver_unittest.cc b/l2tp_ipsec_driver_unittest.cc
index ae8e3c5..6bf52cd 100644
--- a/l2tp_ipsec_driver_unittest.cc
+++ b/l2tp_ipsec_driver_unittest.cc
@@ -7,7 +7,7 @@
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
#include <base/memory/weak_ptr.h>
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include <vpn-manager/service_error.h>
#include <gtest/gtest.h>
@@ -117,12 +117,12 @@
}
bool IsPSKFileCleared(const FilePath &psk_file_path) const {
- return !file_util::PathExists(psk_file_path) && GetPSKFile().empty();
+ return !base::PathExists(psk_file_path) && GetPSKFile().empty();
}
bool IsXauthCredentialsFileCleared(
const FilePath &xauth_credentials_file_path) const {
- return !file_util::PathExists(xauth_credentials_file_path) &&
+ return !base::PathExists(xauth_credentials_file_path) &&
GetXauthCredentialsFile().empty();
}
@@ -216,19 +216,19 @@
FilePath L2TPIPSecDriverTest::SetupPSKFile() {
FilePath psk_file;
- EXPECT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), &psk_file));
+ EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &psk_file));
EXPECT_FALSE(psk_file.empty());
- EXPECT_TRUE(file_util::PathExists(psk_file));
+ EXPECT_TRUE(base::PathExists(psk_file));
driver_->psk_file_ = psk_file;
return psk_file;
}
FilePath L2TPIPSecDriverTest::SetupXauthCredentialsFile() {
FilePath xauth_credentials_file;
- EXPECT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(),
- &xauth_credentials_file));
+ EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
+ &xauth_credentials_file));
EXPECT_FALSE(xauth_credentials_file.empty());
- EXPECT_TRUE(file_util::PathExists(xauth_credentials_file));
+ EXPECT_TRUE(base::PathExists(xauth_credentials_file));
driver_->xauth_credentials_file_ = xauth_credentials_file;
return xauth_credentials_file;
}
@@ -343,8 +343,7 @@
ExpectInFlags(options, "--psk_file", driver_->psk_file_.value());
EXPECT_TRUE(error.IsSuccess());
string contents;
- EXPECT_TRUE(
- file_util::ReadFileToString(driver_->psk_file_, &contents));
+ EXPECT_TRUE(base::ReadFileToString(driver_->psk_file_, &contents));
EXPECT_EQ(kPSK, contents);
struct stat buf;
ASSERT_EQ(0, stat(driver_->psk_file_.value().c_str(), &buf));
@@ -443,7 +442,7 @@
driver_->xauth_credentials_file_.value());
string contents;
EXPECT_TRUE(
- file_util::ReadFileToString(driver_->xauth_credentials_file_, &contents));
+ base::ReadFileToString(driver_->xauth_credentials_file_, &contents));
string expected_contents(string(kUser) + "\n" + kPassword + "\n");
EXPECT_EQ(expected_contents, contents);
struct stat buf;
@@ -733,7 +732,7 @@
Mock::VerifyAndClearExpectations(local_external_task);
EXPECT_CALL(*local_external_task, OnDelete());
- dispatcher_.PostTask(MessageLoop::QuitClosure());
+ dispatcher_.PostTask(base::MessageLoop::QuitClosure());
dispatcher_.DispatchForever();
}
diff --git a/link_monitor.cc b/link_monitor.cc
index 7b1af63..d60c041 100644
--- a/link_monitor.cc
+++ b/link_monitor.cc
@@ -8,8 +8,8 @@
#include <vector>
#include <base/bind.h>
-#include <base/stringprintf.h>
-#include <base/string_util.h>
+#include <base/strings/stringprintf.h>
+#include <base/strings/string_util.h>
#include "shill/arp_client.h"
#include "shill/arp_packet.h"
diff --git a/manager.cc b/manager.cc
index b3a62b1..41d471d 100644
--- a/manager.cc
+++ b/manager.cc
@@ -15,9 +15,9 @@
#include <base/bind.h>
#include <base/file_util.h>
#include <base/memory/ref_counted.h>
-#include <base/stringprintf.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
+#include <base/strings/stringprintf.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/adaptor_interfaces.h"
@@ -209,7 +209,7 @@
Bind(&Metrics::NotifyPowerStateChange, Unretained(metrics_));
power_manager_->AddStateChangeCallback(Metrics::kMetricPowerManagerKey, cb);
- CHECK(file_util::CreateDirectory(run_path_)) << run_path_.value();
+ CHECK(base::CreateDirectory(run_path_)) << run_path_.value();
resolver_->set_path(run_path_.Append("resolv.conf"));
InitializeProfiles();
@@ -267,7 +267,7 @@
void Manager::InitializeProfiles() {
DCHECK(profiles_.empty()); // The default profile must go first on stack.
- CHECK(file_util::CreateDirectory(storage_path_)) << storage_path_.value();
+ CHECK(base::CreateDirectory(storage_path_)) << storage_path_.value();
// Ensure that we have storage for the default profile, and that
// the persistent copy of the default profile is not corrupt.
diff --git a/manager.h b/manager.h
index 88d3cd6..6bde320 100644
--- a/manager.h
+++ b/manager.h
@@ -11,7 +11,7 @@
#include <base/basictypes.h>
#include <base/cancelable_callback.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/ref_counted.h>
#include <base/memory/scoped_ptr.h>
#include <base/memory/weak_ptr.h>
diff --git a/manager_unittest.cc b/manager_unittest.cc
index 845b15b..cc950ba 100644
--- a/manager_unittest.cc
+++ b/manager_unittest.cc
@@ -12,7 +12,7 @@
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
#include <base/stl_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -1085,7 +1085,7 @@
FilePath(storage_path()).Append(string(kProfile0) + ".profile"));
ASSERT_EQ(Error::kSuccess, TestCreateProfile(&manager, kProfile0));
- ASSERT_TRUE(file_util::PathExists(profile_path));
+ ASSERT_TRUE(base::PathExists(profile_path));
EXPECT_EQ(Error::kSuccess, TestPushProfile(&manager, kProfile0));
@@ -1097,7 +1097,7 @@
}
// Profile path should still exist.
- EXPECT_TRUE(file_util::PathExists(profile_path));
+ EXPECT_TRUE(base::PathExists(profile_path));
EXPECT_EQ(Error::kSuccess, TestPopAnyProfile(&manager));
@@ -1109,9 +1109,9 @@
}
// Profile path should no longer exist.
- EXPECT_FALSE(file_util::PathExists(profile_path));
+ EXPECT_FALSE(base::PathExists(profile_path));
- // Another remove succeeds, due to a foible in file_util::Delete --
+ // Another remove succeeds, due to a foible in base::DeleteFile --
// it is not an error to delete a file that does not exist.
{
Error error;
@@ -1121,7 +1121,7 @@
// Let's create an error case that will "work". Create a non-empty
// directory in the place of the profile pathname.
- ASSERT_TRUE(file_util::CreateDirectory(profile_path.Append("foo")));
+ ASSERT_TRUE(base::CreateDirectory(profile_path.Append("foo")));
{
Error error;
manager.RemoveProfile(kProfile0, &error);
@@ -1199,12 +1199,12 @@
FilePath(storage_path()).Append(string(kProfile0) + ".profile"));
ASSERT_EQ(Error::kSuccess, TestCreateProfile(&manager, kProfile0));
- ASSERT_TRUE(file_util::PathExists(profile_path));
+ ASSERT_TRUE(base::PathExists(profile_path));
EXPECT_EQ(Error::kSuccess, TestPushProfile(&manager, kProfile0));
// Ensure that even if the backing filestore is removed, we still can't
// create a profile twice.
- ASSERT_TRUE(file_util::Delete(profile_path, false));
+ ASSERT_TRUE(base::DeleteFile(profile_path, false));
EXPECT_EQ(Error::kAlreadyExists, TestCreateProfile(&manager, kProfile0));
}
diff --git a/memory_log.cc b/memory_log.cc
index f87eaab..1841ee1 100644
--- a/memory_log.cc
+++ b/memory_log.cc
@@ -15,7 +15,7 @@
#include <iomanip>
#include <string>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
#include "shill/logging.h"
@@ -72,7 +72,7 @@
}
void MemoryLog::FlushToDisk() {
- if (file_util::PathExists(FilePath(kLoggedInTokenPath))) {
+ if (base::PathExists(FilePath(kLoggedInTokenPath))) {
FlushToDiskImpl(FilePath(kDefaultLoggedInDumpPath));
} else {
FlushToDiskImpl(FilePath(kDefaultLoggedOutDumpPath));
@@ -84,12 +84,12 @@
do {
// If the file exists, lets make sure it is of reasonable size before
// writing to it, and roll it over if it's too big.
- if (!file_util::PathExists(file_path)) {
+ if (!base::PathExists(file_path)) {
// No existing file means we can write without worry to a new file.
continue;
}
int64_t file_size = -1;
- if (!file_util::GetFileSize(file_path, &file_size) || (file_size < 0)) {
+ if (!base::GetFileSize(file_path, &file_size) || (file_size < 0)) {
LOG(ERROR) << "Failed to get size of existing memory log dump.";
return;
}
@@ -98,7 +98,7 @@
// File existed, but was below our threshold.
continue;
}
- if (!file_util::Move(file_path, backup_path)) {
+ if (!base::Move(file_path, backup_path)) {
LOG(ERROR) << "Failed to move overly large memory log on disk from "
<< file_path.value() << " to " << backup_path.value();
return;
@@ -113,7 +113,7 @@
}
ssize_t MemoryLog::FlushToFile(const FilePath &file_path) {
- FILE *f = file_util::OpenFile(file_path, "a");
+ FILE *f = base::OpenFile(file_path, "a");
if (!f) {
LOG(ERROR) << "Failed to open file for dumping memory log to disk.";
return -1;
diff --git a/memory_log_unittest.cc b/memory_log_unittest.cc
index 60b1094..f55699b 100644
--- a/memory_log_unittest.cc
+++ b/memory_log_unittest.cc
@@ -5,7 +5,7 @@
#include <deque>
#include <string>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
#include <gmock/gmock.h>
@@ -132,7 +132,7 @@
EXPECT_LT(minimal_message_length,
MemoryLog::GetInstance()->FlushToFile(test_path));
std::string file_contents;
- EXPECT_TRUE(file_util::ReadFileToString(test_path, &file_contents));
+ EXPECT_TRUE(base::ReadFileToString(test_path, &file_contents));
// Log should contain all three messages
EXPECT_NE(file_contents.find(kTestStr1), std::string::npos);
EXPECT_NE(file_contents.find(kTestStr2), std::string::npos);
@@ -151,7 +151,7 @@
_,
"Failed to open file for dumping memory log to disk."));
EXPECT_CALL(log, Log(_, _, "Failed to flush memory log to disk"));
- file_util::CreateTemporaryFile(&tmp_path);
+ base::CreateTemporaryFile(&tmp_path);
// Flushing fails because a directory already exists with the same name as
// our log file.
MemoryLog::GetInstance()->FlushToDiskImpl(
@@ -160,7 +160,7 @@
TEST_F(MemoryLogTest, MemoryLogFlushToDiskRotateWorks) {
FilePath tmp_dir;
- file_util::CreateNewTempDirectory(std::string("/"), &tmp_dir);
+ base::CreateNewTempDirectory(std::string("/"), &tmp_dir);
FilePath log_path = tmp_dir.Append("connectivity.log");
FilePath log_path_backup = tmp_dir.Append("connectivity.bak");
LOG(INFO) << kTestStr1;
@@ -168,7 +168,7 @@
// Populate a dump file with some messages.
MemoryLog::GetInstance()->FlushToDiskImpl(log_path);
// There should be no rotated file at this point, we've only done one dump.
- EXPECT_FALSE(file_util::PathExists(log_path_backup));
+ EXPECT_FALSE(base::PathExists(log_path_backup));
// Tell MemoryLog it should rotate at a really small size threshhold.
MemoryLog::GetInstance()->TestSetMaxDiskLogSize(1);
LOG(INFO) << kTestStr3;
@@ -178,17 +178,17 @@
MemoryLog::GetInstance()->TestSetMaxDiskLogSize(
MemoryLog::kDefaultMaxDiskLogSizeInBytes);
std::string file_contents;
- EXPECT_TRUE(file_util::ReadFileToString(log_path_backup, &file_contents));
+ EXPECT_TRUE(base::ReadFileToString(log_path_backup, &file_contents));
// Rotated log should contain the first two messages.
EXPECT_NE(file_contents.find(kTestStr1), std::string::npos);
EXPECT_NE(file_contents.find(kTestStr2), std::string::npos);
- EXPECT_TRUE(file_util::Delete(tmp_dir, true));
+ EXPECT_TRUE(base::DeleteFile(tmp_dir, true));
}
TEST_F(MemoryLogTest, MemoryLogFlushToDiskWorks) {
ScopedMockLog log;
FilePath tmp_path;
- file_util::CreateTemporaryFile(&tmp_path);
+ base::CreateTemporaryFile(&tmp_path);
LOG(INFO) << kTestStr1;
LOG(INFO) << kTestStr2;
LOG(INFO) << kTestStr3;
@@ -196,15 +196,15 @@
EXPECT_CALL(log, Log(_, _, ::testing::EndsWith(tmp_path.AsUTF8Unsafe())));
MemoryLog::GetInstance()->FlushToDiskImpl(tmp_path);
// No rotation should have happened.
- EXPECT_FALSE(file_util::PathExists(tmp_path.Append(".bak")));
+ EXPECT_FALSE(base::PathExists(tmp_path.Append(".bak")));
// But we should have a dump file now.
std::string file_contents;
- EXPECT_TRUE(file_util::ReadFileToString(tmp_path, &file_contents));
+ EXPECT_TRUE(base::ReadFileToString(tmp_path, &file_contents));
// Dump file should contain everything we logged.
EXPECT_NE(file_contents.find(kTestStr1), std::string::npos);
EXPECT_NE(file_contents.find(kTestStr2), std::string::npos);
EXPECT_NE(file_contents.find(kTestStr3), std::string::npos);
- EXPECT_TRUE(file_util::Delete(tmp_path, false));
+ EXPECT_TRUE(base::DeleteFile(tmp_path, false));
}
// Test that most messages go through MemoryLog
diff --git a/metrics.cc b/metrics.cc
index c5b09ce..02609da 100644
--- a/metrics.cc
+++ b/metrics.cc
@@ -4,8 +4,8 @@
#include "shill/metrics.h"
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <metrics/bootstat.h>
@@ -581,11 +581,10 @@
SendServiceFailure(service);
if (collect_bootstats_) {
- bootstat_log(
- StringPrintf("network-%s-%s",
- Technology::NameFromIdentifier(
- service.technology()).c_str(),
- service.GetStateString().c_str()).c_str());
+ bootstat_log(base::StringPrintf("network-%s-%s",
+ Technology::NameFromIdentifier(
+ service.technology()).c_str(),
+ service.GetStateString().c_str()).c_str());
}
if (new_state != Service::kStateConnected)
diff --git a/mock_device.cc b/mock_device.cc
index bf37723..7f885af 100644
--- a/mock_device.cc
+++ b/mock_device.cc
@@ -7,7 +7,7 @@
#include <string>
#include <base/memory/ref_counted.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
namespace shill {
diff --git a/mock_pending_activation_store.h b/mock_pending_activation_store.h
index 7978c1f..aaa14ec 100644
--- a/mock_pending_activation_store.h
+++ b/mock_pending_activation_store.h
@@ -7,7 +7,7 @@
#include <string>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <gmock/gmock.h>
#include "shill/pending_activation_store.h"
diff --git a/mock_profile.cc b/mock_profile.cc
index 797d172..7e093f1 100644
--- a/mock_profile.cc
+++ b/mock_profile.cc
@@ -7,7 +7,7 @@
#include <string>
#include <base/memory/ref_counted.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include "shill/refptr_types.h"
diff --git a/mock_service.cc b/mock_service.cc
index 8deff4a..e82aefe 100644
--- a/mock_service.cc
+++ b/mock_service.cc
@@ -7,7 +7,7 @@
#include <string>
#include <base/memory/ref_counted.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include "shill/refptr_types.h"
diff --git a/modem.cc b/modem.cc
index e7387c4..c14a9f0 100644
--- a/modem.cc
+++ b/modem.cc
@@ -5,7 +5,7 @@
#include "shill/modem.h"
#include <base/bind.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/cellular.h"
#include "shill/logging.h"
diff --git a/modem_info.cc b/modem_info.cc
index 124f3df..29a418f 100644
--- a/modem_info.cc
+++ b/modem_info.cc
@@ -4,7 +4,7 @@
#include "shill/modem_info.h"
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <mm/mm-modem.h>
#include <mobile_provider.h>
@@ -47,7 +47,6 @@
metrics_(metrics),
manager_(manager),
glib_(glib),
- pending_activation_store_(NULL),
provider_db_path_(kMobileProviderDBPath),
provider_db_(NULL) {}
diff --git a/modem_unittest.cc b/modem_unittest.cc
index 934d849..c317a23 100644
--- a/modem_unittest.cc
+++ b/modem_unittest.cc
@@ -6,7 +6,7 @@
#include <vector>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <mm/mm-modem.h>
diff --git a/netlink_attribute.cc b/netlink_attribute.cc
index 32f2a56..60631ca 100644
--- a/netlink_attribute.cc
+++ b/netlink_attribute.cc
@@ -10,7 +10,7 @@
#include <string>
#include <base/format_macros.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/attribute_list.h"
#include "shill/control_netlink_attribute.h"
diff --git a/netlink_manager_unittest.cc b/netlink_manager_unittest.cc
index 95b9707..2981fd3 100644
--- a/netlink_manager_unittest.cc
+++ b/netlink_manager_unittest.cc
@@ -14,7 +14,7 @@
#include <string>
#include <vector>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/netlink_message.cc b/netlink_message.cc
index 9d0ba3b..3c6be3a 100644
--- a/netlink_message.cc
+++ b/netlink_message.cc
@@ -13,7 +13,7 @@
#include <base/format_macros.h>
#include <base/stl_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/logging.h"
diff --git a/netlink_message_unittest.cc b/netlink_message_unittest.cc
index 2d58890..5223536 100644
--- a/netlink_message_unittest.cc
+++ b/netlink_message_unittest.cc
@@ -14,7 +14,7 @@
#include <string>
#include <vector>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/nl80211_attribute.cc b/nl80211_attribute.cc
index 2041181..1a15814 100644
--- a/nl80211_attribute.cc
+++ b/nl80211_attribute.cc
@@ -10,7 +10,7 @@
#include <base/bind.h>
#include <base/format_macros.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/logging.h"
diff --git a/nl80211_message.cc b/nl80211_message.cc
index 440af20..db3e52e 100644
--- a/nl80211_message.cc
+++ b/nl80211_message.cc
@@ -33,7 +33,7 @@
#include <vector>
#include <base/bind.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/attribute_list.h"
#include "shill/ieee80211.h"
@@ -647,7 +647,7 @@
case UnprotDisassociateMessage::kCommand:
return new UnprotDisassociateMessage();
default:
- LOG(WARNING) << StringPrintf(
+ LOG(WARNING) << base::StringPrintf(
"Unknown/unhandled netlink nl80211 message 0x%02x", gnlh->cmd);
return new UnknownNl80211Message(gnlh->cmd);
break;
diff --git a/nss.cc b/nss.cc
index 9b3783b..36974e3 100644
--- a/nss.cc
+++ b/nss.cc
@@ -4,9 +4,9 @@
#include "shill/nss.h"
-#include <base/string_number_conversions.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include "shill/logging.h"
#include "shill/minijail.h"
diff --git a/nss.h b/nss.h
index 21fe77d..4b0b1d6 100644
--- a/nss.h
+++ b/nss.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/lazy_instance.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
diff --git a/openvpn_driver.cc b/openvpn_driver.cc
index ad84109..8939b36 100644
--- a/openvpn_driver.cc
+++ b/openvpn_driver.cc
@@ -7,9 +7,9 @@
#include <arpa/inet.h>
#include <base/file_util.h>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/certificate_file.h"
@@ -183,11 +183,11 @@
// above and then terminating and reaping the process through ProcessKiller.
management_server_->Stop();
if (!tls_auth_file_.empty()) {
- file_util::Delete(tls_auth_file_, false);
+ base::DeleteFile(tls_auth_file_, false);
tls_auth_file_.clear();
}
if (!openvpn_config_file_.empty()) {
- file_util::Delete(openvpn_config_file_, false);
+ base::DeleteFile(openvpn_config_file_, false);
openvpn_config_file_.clear();
}
if (default_service_callback_tag_) {
@@ -241,9 +241,9 @@
argument.find(separator) != string::npos) {
string quoted_argument(argument);
const char separator_chars[] = { separator, '\0' };
- ReplaceChars(argument, separator_chars, " ", "ed_argument);
- ReplaceChars(quoted_argument, "\\", "\\\\", "ed_argument);
- ReplaceChars(quoted_argument, "\"", "\\\"", "ed_argument);
+ base::ReplaceChars(argument, separator_chars, " ", "ed_argument);
+ base::ReplaceChars(quoted_argument, "\\", "\\\\", "ed_argument);
+ base::ReplaceChars(quoted_argument, "\"", "\\\"", "ed_argument);
quoted_option.push_back("\"" + quoted_argument + "\"");
} else {
quoted_option.push_back(argument);
@@ -257,8 +257,8 @@
bool OpenVPNDriver::WriteConfigFile(
const vector<vector<string>> &options,
FilePath *config_file) {
- if (!file_util::DirectoryExists(openvpn_config_directory_)) {
- if (!file_util::CreateDirectory(openvpn_config_directory_)) {
+ if (!base::DirectoryExists(openvpn_config_directory_)) {
+ if (!base::CreateDirectory(openvpn_config_directory_)) {
LOG(ERROR) << "Unable to create configuration directory "
<< openvpn_config_directory_.value();
return false;
@@ -266,17 +266,16 @@
if (chmod(openvpn_config_directory_.value().c_str(), S_IRWXU)) {
LOG(ERROR) << "Failed to set permissions on "
<< openvpn_config_directory_.value();
- file_util::Delete(openvpn_config_directory_, true);
+ base::DeleteFile(openvpn_config_directory_, true);
return false;
}
}
string contents = JoinOptions(options, '\n');
contents.push_back('\n');
- if (!file_util::CreateTemporaryFileInDir(openvpn_config_directory_,
- config_file) ||
+ if (!base::CreateTemporaryFileInDir(openvpn_config_directory_, config_file) ||
file_util::WriteFile(*config_file, contents.data(), contents.size()) !=
- static_cast<int>(contents.size())) {
+ static_cast<int>(contents.size())) {
LOG(ERROR) << "Unable to setup OpenVPN config file.";
return false;
}
@@ -615,7 +614,7 @@
string contents =
args()->LookupString(kOpenVPNTLSAuthContentsProperty, "");
if (!contents.empty()) {
- if (!file_util::CreateTemporaryFile(&tls_auth_file_) ||
+ if (!base::CreateTemporaryFile(&tls_auth_file_) ||
file_util::WriteFile(
tls_auth_file_, contents.data(), contents.size()) !=
static_cast<int>(contents.size())) {
@@ -998,7 +997,7 @@
bool OpenVPNDriver::ParseLSBRelease(map<string, string> *lsb_release) {
SLOG(VPN, 2) << __func__ << "(" << lsb_release_file_.value() << ")";
string contents;
- if (!file_util::ReadFileToString(lsb_release_file_, &contents)) {
+ if (!base::ReadFileToString(lsb_release_file_, &contents)) {
LOG(ERROR) << "Unable to read the lsb-release file: "
<< lsb_release_file_.value();
return false;
diff --git a/openvpn_driver.h b/openvpn_driver.h
index f47e015..55bccc3 100644
--- a/openvpn_driver.h
+++ b/openvpn_driver.h
@@ -9,7 +9,7 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/scoped_ptr.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
diff --git a/openvpn_driver_unittest.cc b/openvpn_driver_unittest.cc
index f1b62b6..eb7f6fb 100644
--- a/openvpn_driver_unittest.cc
+++ b/openvpn_driver_unittest.cc
@@ -6,11 +6,11 @@
#include <algorithm>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <gtest/gtest.h>
@@ -123,7 +123,7 @@
driver_->device_ = NULL;
driver_->service_ = NULL;
if (!lsb_release_file_.empty()) {
- EXPECT_TRUE(file_util::Delete(lsb_release_file_, false));
+ EXPECT_TRUE(base::DeleteFile(lsb_release_file_, false));
lsb_release_file_.clear();
}
}
@@ -321,7 +321,7 @@
"CHROMEOS_RELEASE_BOARD=x86-alex\n"
"CHROMEOS_RELEASE_NAME=Chromium OS\n"
"CHROMEOS_RELEASE_VERSION=2202.0\n";
- EXPECT_TRUE(file_util::CreateTemporaryFile(&lsb_release_file_));
+ EXPECT_TRUE(base::CreateTemporaryFile(&lsb_release_file_));
EXPECT_EQ(arraysize(kLSBReleaseContents),
file_util::WriteFile(lsb_release_file_,
kLSBReleaseContents,
@@ -719,8 +719,7 @@
ASSERT_FALSE(driver_->tls_auth_file_.empty());
ExpectInFlags(options, "tls-auth", driver_->tls_auth_file_.value());
string contents;
- EXPECT_TRUE(
- file_util::ReadFileToString(driver_->tls_auth_file_, &contents));
+ EXPECT_TRUE(base::ReadFileToString(driver_->tls_auth_file_, &contents));
EXPECT_EQ(kTLSAuthContents, contents);
ExpectInFlags(options, "pkcs11-id", kID);
ExpectInFlags(options, "ca", OpenVPNDriver::kDefaultCACertificates);
@@ -1172,9 +1171,9 @@
driver_->ip_properties_.address = "1.2.3.4";
StartConnectTimeout(0);
FilePath tls_auth_file;
- EXPECT_TRUE(file_util::CreateTemporaryFile(&tls_auth_file));
+ EXPECT_TRUE(base::CreateTemporaryFile(&tls_auth_file));
EXPECT_FALSE(tls_auth_file.empty());
- EXPECT_TRUE(file_util::PathExists(tls_auth_file));
+ EXPECT_TRUE(base::PathExists(tls_auth_file));
driver_->tls_auth_file_ = tls_auth_file;
// Stop will be called twice -- once by Cleanup and once by the destructor.
EXPECT_CALL(*management_server_, Stop()).Times(2);
@@ -1195,7 +1194,7 @@
EXPECT_FALSE(driver_->device_);
EXPECT_FALSE(driver_->service_);
EXPECT_EQ(kErrorDetails, service_->error_details());
- EXPECT_FALSE(file_util::PathExists(tls_auth_file));
+ EXPECT_FALSE(base::PathExists(tls_auth_file));
EXPECT_TRUE(driver_->tls_auth_file_.empty());
EXPECT_TRUE(driver_->ip_properties_.address.empty());
EXPECT_FALSE(driver_->IsConnectTimeoutStarted());
@@ -1449,15 +1448,15 @@
FilePath config_directory(
temporary_directory_.path().Append(kOpenVPNConfigDirectory));
FilePath config_file;
- EXPECT_FALSE(file_util::PathExists(config_directory));
+ EXPECT_FALSE(base::PathExists(config_directory));
EXPECT_TRUE(driver_->WriteConfigFile(options, &config_file));
- EXPECT_TRUE(file_util::PathExists(config_directory));
- EXPECT_TRUE(file_util::PathExists(config_file));
- EXPECT_TRUE(file_util::ContainsPath(config_directory, config_file));
+ EXPECT_TRUE(base::PathExists(config_directory));
+ EXPECT_TRUE(base::PathExists(config_file));
+ EXPECT_TRUE(config_directory.IsParent(config_file));
string config_contents;
- EXPECT_TRUE(file_util::ReadFileToString(config_file, &config_contents));
- string expected_config_contents = StringPrintf(
+ EXPECT_TRUE(base::ReadFileToString(config_file, &config_contents));
+ string expected_config_contents = base::StringPrintf(
"%s\n%s %s\n%s \"%s\" \"%s\"\n",
kOption0,
kOption1, kOption1Argument0,
diff --git a/openvpn_management_server.cc b/openvpn_management_server.cc
index 86619e6..4255f24 100644
--- a/openvpn_management_server.cc
+++ b/openvpn_management_server.cc
@@ -8,10 +8,10 @@
#include <netinet/in.h>
#include <base/bind.h>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/error.h"
diff --git a/pending_activation_store.h b/pending_activation_store.h
index f27af77..678d406 100644
--- a/pending_activation_store.h
+++ b/pending_activation_store.h
@@ -7,7 +7,7 @@
#include <string>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/scoped_ptr.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
diff --git a/portal_detector.cc b/portal_detector.cc
index 14ebe93..c2b72d8 100644
--- a/portal_detector.cc
+++ b/portal_detector.cc
@@ -7,9 +7,9 @@
#include <string>
#include <base/bind.h>
-#include <base/string_number_conversions.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include "shill/async_connection.h"
#include "shill/connection.h"
diff --git a/power_manager_proxy_interface.h b/power_manager_proxy_interface.h
index 31e484c..8b590a4 100644
--- a/power_manager_proxy_interface.h
+++ b/power_manager_proxy_interface.h
@@ -8,7 +8,7 @@
#include <string>
#include <base/basictypes.h>
-#include <base/time.h>
+#include <base/time/time.h>
namespace shill {
diff --git a/profile.cc b/profile.cc
index 911be12..1de8fe3 100644
--- a/profile.cc
+++ b/profile.cc
@@ -8,12 +8,12 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
#include <base/stl_util.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/adaptor_interfaces.h"
@@ -133,7 +133,7 @@
return false;
}
- if (!file_util::Delete(path, false)) {
+ if (!base::DeleteFile(path, false)) {
Error::PopulateAndLog(
error, Error::kOperationFailed,
base::StringPrintf("Could not remove path %s", path.value().c_str()));
@@ -278,7 +278,7 @@
vector<Profile::Identifier> Profile::LoadUserProfileList(const FilePath &path) {
vector<Identifier> profile_identifiers;
string profile_data;
- if (!file_util::ReadFileToString(path, &profile_data)) {
+ if (!base::ReadFileToString(path, &profile_data)) {
return profile_identifiers;
}
diff --git a/profile_unittest.cc b/profile_unittest.cc
index d7d2af2..0f6f446 100644
--- a/profile_unittest.cc
+++ b/profile_unittest.cc
@@ -7,11 +7,11 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
#include <base/memory/scoped_ptr.h>
-#include <base/stringprintf.h>
-#include <base/string_util.h>
+#include <base/strings/stringprintf.h>
+#include <base/strings/string_util.h>
#include <gtest/gtest.h>
#include "shill/glib.h"
@@ -388,10 +388,10 @@
EXPECT_TRUE(Profile::SaveUserProfileList(list_path, profiles));
string profile_data;
- EXPECT_TRUE(file_util::ReadFileToString(list_path, &profile_data));
- EXPECT_EQ(StringPrintf("~%s/%s %s\n~%s/%s %s\n",
- kUser0, kIdentifier0, kHash0,
- kUser1, kIdentifier1, kHash1),
+ EXPECT_TRUE(base::ReadFileToString(list_path, &profile_data));
+ EXPECT_EQ(base::StringPrintf("~%s/%s %s\n~%s/%s %s\n",
+ kUser0, kIdentifier0, kHash0,
+ kUser1, kIdentifier1, kHash1),
profile_data);
}
diff --git a/resolver.cc b/resolver.cc
index a3e2fa4..5868266 100644
--- a/resolver.cc
+++ b/resolver.cc
@@ -9,8 +9,8 @@
#include <vector>
#include <base/file_util.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include "shill/ipconfig.h"
#include "shill/logging.h"
@@ -94,7 +94,7 @@
CHECK(!path_.empty());
- return file_util::Delete(path_, false);
+ return base::DeleteFile(path_, false);
}
} // namespace shill
diff --git a/resolver.h b/resolver.h
index d50d33f..9881e04 100644
--- a/resolver.h
+++ b/resolver.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/lazy_instance.h>
#include <base/memory/ref_counted.h>
diff --git a/resolver_unittest.cc b/resolver_unittest.cc
index ad5e0a1..5a5dbdc 100644
--- a/resolver_unittest.cc
+++ b/resolver_unittest.cc
@@ -7,7 +7,7 @@
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
#include <base/stl_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gtest/gtest.h>
#include "shill/mock_control.h"
@@ -62,12 +62,12 @@
string ResolverTest::ReadFile() {
string data;
- EXPECT_TRUE(file_util::ReadFileToString(resolver_->path_, &data));
+ EXPECT_TRUE(base::ReadFileToString(resolver_->path_, &data));
return data;
}
TEST_F(ResolverTest, NonEmpty) {
- EXPECT_FALSE(file_util::PathExists(path_));
+ EXPECT_FALSE(base::PathExists(path_));
EXPECT_TRUE(resolver_->ClearDNS());
MockControl control;
@@ -79,25 +79,25 @@
domain_search.push_back(kSearchDomain1);
EXPECT_TRUE(resolver_->SetDNSFromLists(dns_servers, domain_search));
- EXPECT_TRUE(file_util::PathExists(path_));
+ EXPECT_TRUE(base::PathExists(path_));
EXPECT_EQ(kExpectedOutput, ReadFile());
EXPECT_TRUE(resolver_->ClearDNS());
}
TEST_F(ResolverTest, Empty) {
- EXPECT_FALSE(file_util::PathExists(path_));
+ EXPECT_FALSE(base::PathExists(path_));
MockControl control;
vector<string> dns_servers;
vector<string> domain_search;
EXPECT_TRUE(resolver_->SetDNSFromLists(dns_servers, domain_search));
- EXPECT_FALSE(file_util::PathExists(path_));
+ EXPECT_FALSE(base::PathExists(path_));
}
TEST_F(ResolverTest, IgnoredSearchList) {
- EXPECT_FALSE(file_util::PathExists(path_));
+ EXPECT_FALSE(base::PathExists(path_));
EXPECT_TRUE(resolver_->ClearDNS());
MockControl control;
@@ -112,7 +112,7 @@
ignored_search.push_back(kSearchDomain2);
resolver_->set_ignored_search_list(ignored_search);
EXPECT_TRUE(resolver_->SetDNSFromLists(dns_servers, domain_search));
- EXPECT_TRUE(file_util::PathExists(path_));
+ EXPECT_TRUE(base::PathExists(path_));
EXPECT_EQ(kExpectedIgnoredSearchOutput, ReadFile());
EXPECT_TRUE(resolver_->ClearDNS());
diff --git a/routing_table.cc b/routing_table.cc
index 17fc9e9..23d3d5a 100644
--- a/routing_table.cc
+++ b/routing_table.cc
@@ -19,12 +19,12 @@
#include <string>
#include <base/bind.h>
-#include <base/file_path.h>
+#include <base/containers/hash_tables.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
-#include <base/hash_tables.h>
#include <base/memory/scoped_ptr.h>
#include <base/stl_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/byte_string.h"
#include "shill/logging.h"
@@ -53,7 +53,6 @@
RoutingTable::RoutingTable()
: route_callback_(Bind(&RoutingTable::RouteMsgHandler, Unretained(this))),
- route_listener_(NULL),
rtnl_handler_(RTNLHandler::GetInstance()) {
SLOG(Route, 2) << __func__;
}
diff --git a/routing_table.h b/routing_table.h
index d56465c..59b9817 100644
--- a/routing_table.h
+++ b/routing_table.h
@@ -10,7 +10,7 @@
#include <vector>
#include <base/callback.h>
-#include <base/hash_tables.h>
+#include <base/containers/hash_tables.h>
#include <base/lazy_instance.h>
#include <base/memory/ref_counted.h>
#include <base/memory/scoped_ptr.h>
diff --git a/rpc_task.cc b/rpc_task.cc
index 25eb081..909bf75 100644
--- a/rpc_task.cc
+++ b/rpc_task.cc
@@ -4,7 +4,7 @@
#include "shill/rpc_task.h"
-#include <base/string_number_conversions.h>
+#include <base/strings/string_number_conversions.h>
#include "shill/adaptor_interfaces.h"
#include "shill/control_interface.h"
diff --git a/rtnl_handler.h b/rtnl_handler.h
index 69a591e..42e51ac 100644
--- a/rtnl_handler.h
+++ b/rtnl_handler.h
@@ -9,7 +9,7 @@
#include <vector>
#include <base/callback.h>
-#include <base/hash_tables.h>
+#include <base/containers/hash_tables.h>
#include <base/lazy_instance.h>
#include <base/memory/ref_counted.h>
#include <base/memory/scoped_ptr.h>
diff --git a/rtnl_message.h b/rtnl_message.h
index 61e0700..a7eb8e8 100644
--- a/rtnl_message.h
+++ b/rtnl_message.h
@@ -6,7 +6,7 @@
#define SHILL_RTNL_MESSAGE_
#include <base/basictypes.h>
-#include <base/hash_tables.h>
+#include <base/containers/hash_tables.h>
#include <base/stl_util.h>
#include "shill/byte_string.h"
diff --git a/scan_session.cc b/scan_session.cc
index c2be066..c0912bb 100644
--- a/scan_session.cc
+++ b/scan_session.cc
@@ -12,7 +12,7 @@
#include <base/bind.h>
#include <base/memory/weak_ptr.h>
#include <base/stl_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include "shill/event_dispatcher.h"
#include "shill/logging.h"
diff --git a/scope_logger.cc b/scope_logger.cc
index 786a16c..16e5869 100644
--- a/scope_logger.cc
+++ b/scope_logger.cc
@@ -6,8 +6,8 @@
#include <vector>
-#include <base/string_util.h>
#include <base/strings/string_tokenizer.h>
+#include <base/strings/string_util.h>
using base::StringTokenizer;
using std::string;
diff --git a/service.cc b/service.cc
index dcfc023..87584a2 100644
--- a/service.cc
+++ b/service.cc
@@ -12,8 +12,8 @@
#include <vector>
#include <base/memory/scoped_ptr.h>
-#include <base/string_number_conversions.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/connection.h"
diff --git a/shill.gyp b/shill.gyp
index 3161927..36e7ba2 100644
--- a/shill.gyp
+++ b/shill.gyp
@@ -1,4 +1,7 @@
{
+ 'variables': {
+ 'libbase_ver': 242728,
+ },
'target_defaults': {
'dependencies': [
'../libchromeos/libchromeos-<(libbase_ver).gyp:libchromeos-<(libbase_ver)',
diff --git a/shill_daemon.cc b/shill_daemon.cc
index 9323f76..589e45c 100644
--- a/shill_daemon.cc
+++ b/shill_daemon.cc
@@ -10,7 +10,7 @@
#include <vector>
#include <base/bind.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include "shill/callback80211_metrics.h"
#include "shill/dhcp_provider.h"
@@ -76,7 +76,7 @@
Metrics::kTerminationActionReasonTerminate)) {
SLOG(Daemon, 1) << "No termination actions were run";
Stop();
- dispatcher_.PostTask(MessageLoop::QuitClosure());
+ dispatcher_.PostTask(base::MessageLoop::QuitClosure());
}
}
@@ -85,7 +85,7 @@
metrics_->NotifyTerminationActionsCompleted(
Metrics::kTerminationActionReasonTerminate, error.IsSuccess());
Stop();
- dispatcher_.PostTask(MessageLoop::QuitClosure());
+ dispatcher_.PostTask(base::MessageLoop::QuitClosure());
}
void Daemon::Start() {
diff --git a/shill_main.cc b/shill_main.cc
index 9065ea5..7549ccc 100644
--- a/shill_main.cc
+++ b/shill_main.cc
@@ -13,9 +13,9 @@
#include <base/at_exit.h>
#include <base/command_line.h>
-#include <base/file_path.h>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
+#include <base/files/file_path.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
#include <chromeos/syslog_logging.h>
#include "shill/dbus_control.h"
diff --git a/shill_time.cc b/shill_time.cc
index 45ebf82..195b41a 100644
--- a/shill_time.cc
+++ b/shill_time.cc
@@ -6,7 +6,7 @@
#include <time.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
using std::string;
diff --git a/shill_unittest.cc b/shill_unittest.cc
index 879f814..5c2f167 100644
--- a/shill_unittest.cc
+++ b/shill_unittest.cc
@@ -7,8 +7,8 @@
#include <base/bind.h>
#include <base/cancelable_callback.h>
#include <base/memory/ref_counted.h>
-#include <base/message_loop_proxy.h>
-#include <base/stringprintf.h>
+#include <base/message_loop/message_loop_proxy.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -51,7 +51,6 @@
callback_count_(0),
got_data_(false),
got_ready_(false),
- input_handler_(NULL),
tester_factory_(this) {
}
@@ -82,7 +81,7 @@
}
void StopDispatcher() {
- dispatcher_->PostTask(MessageLoop::QuitClosure());
+ dispatcher_->PostTask(base::MessageLoop::QuitClosure());
}
void Trigger() {
diff --git a/shims/certificates.cc b/shims/certificates.cc
index 64a9a39..705580d 100644
--- a/shims/certificates.cc
+++ b/shims/certificates.cc
@@ -8,7 +8,7 @@
#include <string>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
#include <base/logging.h>
@@ -38,12 +38,13 @@
}
// static
-bool Certificates::Write(const ByteString &cert, const FilePath &certfile) {
+bool Certificates::Write(const ByteString &cert,
+ const base::FilePath &certfile) {
if (file_util::WriteFile(certfile,
reinterpret_cast<const char *>(cert.GetConstData()),
cert.GetLength()) !=
static_cast<int>(cert.GetLength())) {
- file_util::Delete(certfile, false);
+ base::DeleteFile(certfile, false);
LOG(ERROR) << "Unable to save certificate to a file: " << certfile.value();
return false;
}
diff --git a/shims/certificates_unittest.cc b/shims/certificates_unittest.cc
index 9124673..4889533 100644
--- a/shims/certificates_unittest.cc
+++ b/shims/certificates_unittest.cc
@@ -6,7 +6,7 @@
#include <sys/stat.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
#include <gtest/gtest.h>
@@ -43,7 +43,7 @@
base::FilePath certfile = temp_dir.path().Append("certfile");
EXPECT_TRUE(Certificates::Write(cert, certfile));
string contents;
- EXPECT_TRUE(file_util::ReadFileToString(certfile, &contents));
+ EXPECT_TRUE(base::ReadFileToString(certfile, &contents));
EXPECT_EQ(cert_str, contents);
struct stat buf;
EXPECT_EQ(0, stat(certfile.value().c_str(), &buf));
diff --git a/shims/net_diags_upload.cc b/shims/net_diags_upload.cc
index c2dcf62..006710d 100644
--- a/shims/net_diags_upload.cc
+++ b/shims/net_diags_upload.cc
@@ -11,7 +11,7 @@
#include <base/at_exit.h>
#include <base/command_line.h>
#include <base/logging.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/syslog_logging.h>
using std::string;
diff --git a/shims/netfilter_queue_helper.cc b/shims/netfilter_queue_helper.cc
index 8da85c7..2858d0b 100644
--- a/shims/netfilter_queue_helper.cc
+++ b/shims/netfilter_queue_helper.cc
@@ -28,7 +28,7 @@
#include <base/command_line.h>
#include <base/logging.h>
-#include <base/string_number_conversions.h>
+#include <base/strings/string_number_conversions.h>
#include <chromeos/syslog_logging.h>
#include "shill/shims/netfilter_queue_processor.h"
diff --git a/shims/netfilter_queue_processor.cc b/shims/netfilter_queue_processor.cc
index 2bdb7ab..78702c4 100644
--- a/shims/netfilter_queue_processor.cc
+++ b/shims/netfilter_queue_processor.cc
@@ -21,7 +21,7 @@
#include <base/file_util.h>
#include <base/logging.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
using std::deque;
@@ -53,7 +53,7 @@
uint16_t port) {
struct in_addr addr;
addr.s_addr = htonl(ip);
- return StringPrintf("%s:%d", inet_ntoa(addr), port);
+ return base::StringPrintf("%s:%d", inet_ntoa(addr), port);
}
bool NetfilterQueueProcessor::Packet::ParseNetfilterData(
diff --git a/shims/nss_get_cert.cc b/shims/nss_get_cert.cc
index 8e8db1b..77def53 100644
--- a/shims/nss_get_cert.cc
+++ b/shims/nss_get_cert.cc
@@ -9,7 +9,7 @@
#include <string>
#include <base/command_line.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/logging.h>
#include <chromeos/syslog_logging.h>
@@ -80,7 +80,7 @@
const string nickname = argv[1];
const string format_str = argv[2];
- const FilePath outfile(argv[3]);
+ const base::FilePath outfile(argv[3]);
ScopedNSS nss;
ByteString cert;
diff --git a/socket_info_reader.cc b/socket_info_reader.cc
index 2155096..af9c75c 100644
--- a/socket_info_reader.cc
+++ b/socket_info_reader.cc
@@ -7,8 +7,8 @@
#include <algorithm>
#include <limits>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
#include "shill/file_reader.h"
#include "shill/logging.h"
diff --git a/socket_info_reader.h b/socket_info_reader.h
index f8ccea5..fadf481 100644
--- a/socket_info_reader.h
+++ b/socket_info_reader.h
@@ -9,7 +9,7 @@
#include <vector>
#include <base/basictypes.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <gtest/gtest_prod.h>
#include "shill/socket_info.h"
diff --git a/socket_info_reader_unittest.cc b/socket_info_reader_unittest.cc
index 7dff7dc..ba59f66 100644
--- a/socket_info_reader_unittest.cc
+++ b/socket_info_reader_unittest.cc
@@ -6,7 +6,7 @@
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -75,7 +75,7 @@
void CreateSocketInfoFile(const char **lines, size_t num_lines,
const FilePath &dir_path, FilePath *file_path) {
- ASSERT_TRUE(file_util::CreateTemporaryFileInDir(dir_path, file_path));
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(dir_path, file_path));
for (size_t i = 0; i < num_lines; ++i) {
string line = lines[i];
line += '\n';
diff --git a/static_ip_parameters.cc b/static_ip_parameters.cc
index ecd02c7..1cc9fbf 100644
--- a/static_ip_parameters.cc
+++ b/static_ip_parameters.cc
@@ -6,8 +6,8 @@
#include <string.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/error.h"
diff --git a/static_ip_parameters_unittest.cc b/static_ip_parameters_unittest.cc
index e36c69d..d5aa6f0 100644
--- a/static_ip_parameters_unittest.cc
+++ b/static_ip_parameters_unittest.cc
@@ -5,7 +5,7 @@
#include "shill/static_ip_parameters.h"
#include <base/basictypes.h>
-#include <base/string_number_conversions.h>
+#include <base/strings/string_number_conversions.h>
#include <chromeos/dbus/service_constants.h>
#include <gtest/gtest.h>
diff --git a/technology.cc b/technology.cc
index dc543e4..e8687e6 100644
--- a/technology.cc
+++ b/technology.cc
@@ -9,7 +9,7 @@
#include <vector>
#include <base/stl_util.h>
-#include <base/string_split.h>
+#include <base/strings/string_split.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/error.h"
diff --git a/traffic_monitor.cc b/traffic_monitor.cc
index 5873753..9b87457 100644
--- a/traffic_monitor.cc
+++ b/traffic_monitor.cc
@@ -5,7 +5,7 @@
#include "shill/traffic_monitor.h"
#include <base/bind.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <netinet/in.h>
#include "shill/device.h"
diff --git a/traffic_monitor_unittest.cc b/traffic_monitor_unittest.cc
index 67a2005..e4ee9a5 100644
--- a/traffic_monitor_unittest.cc
+++ b/traffic_monitor_unittest.cc
@@ -5,7 +5,7 @@
#include "shill/traffic_monitor.h"
#include <base/bind.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <gtest/gtest.h>
#include <netinet/in.h>
diff --git a/vpn_driver.cc b/vpn_driver.cc
index bd38fde..93b782f 100644
--- a/vpn_driver.cc
+++ b/vpn_driver.cc
@@ -7,7 +7,7 @@
#include <string>
#include <vector>
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/connection.h"
diff --git a/vpn_driver_unittest.cc b/vpn_driver_unittest.cc
index cf766de..de2f2b5 100644
--- a/vpn_driver_unittest.cc
+++ b/vpn_driver_unittest.cc
@@ -5,7 +5,7 @@
#include "shill/vpn_driver.h"
#include <base/stl_util.h>
-#include <base/string_number_conversions.h>
+#include <base/strings/string_number_conversions.h>
#include <chromeos/dbus/service_constants.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/vpn_provider.cc b/vpn_provider.cc
index 947fc53..d7c382d 100644
--- a/vpn_provider.cc
+++ b/vpn_provider.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/error.h"
diff --git a/vpn_service.cc b/vpn_service.cc
index e1541f1..f45d29a 100644
--- a/vpn_service.cc
+++ b/vpn_service.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/key_value_store.h"
diff --git a/wifi.cc b/wifi.cc
index 63bbda8..09d26f5 100644
--- a/wifi.cc
+++ b/wifi.cc
@@ -17,10 +17,10 @@
#include <vector>
#include <base/bind.h>
-#include <base/file_path.h>
#include <base/file_util.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/files/file_path.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <glib.h>
@@ -58,8 +58,8 @@
#include "shill/wpa_supplicant.h"
using base::Bind;
+using base::FilePath;
using base::StringPrintf;
-using file_util::PathExists;
using std::map;
using std::set;
using std::string;
diff --git a/wifi.h b/wifi.h
index 200e914..1747676 100644
--- a/wifi.h
+++ b/wifi.h
@@ -82,7 +82,7 @@
#include <base/callback_forward.h>
#include <base/cancelable_callback.h>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include <base/memory/scoped_ptr.h>
#include <base/memory/weak_ptr.h>
#include <dbus-c++/dbus.h>
@@ -297,7 +297,7 @@
// Gets the list of frequencies supported by this device.
// TODO(wdg): Remove after progressive scan field trial is over.
- void ParseFieldTrialFile(const FilePath &field_trial_file_path);
+ void ParseFieldTrialFile(const base::FilePath &field_trial_file_path);
void ConfigureScanFrequencies();
void AppendBgscan(WiFiService *service,
std::map<std::string, DBus::Variant> *service_params) const;
diff --git a/wifi_endpoint.cc b/wifi_endpoint.cc
index ae17d66..f3a15eb 100644
--- a/wifi_endpoint.cc
+++ b/wifi_endpoint.cc
@@ -7,9 +7,9 @@
#include <algorithm>
#include <base/stl_util.h>
-#include <base/stringprintf.h>
-#include <base/string_number_conversions.h>
-#include <base/string_util.h>
+#include <base/strings/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/ieee80211.h"
@@ -22,6 +22,7 @@
#include "shill/wifi_endpoint.h"
#include "shill/wpa_supplicant.h"
+using base::StringPrintf;
using std::map;
using std::set;
using std::string;
@@ -622,7 +623,7 @@
vector<uint8_t> WiFiEndpoint::MakeHardwareAddressFromString(
const string &bssid_string) {
string bssid_nosep;
- RemoveChars(bssid_string, ":", &bssid_nosep);
+ base::RemoveChars(bssid_string, ":", &bssid_nosep);
vector<uint8_t> bssid_bytes;
base::HexStringToBytes(bssid_nosep, &bssid_bytes);
if (bssid_bytes.size() != kBSSIDLength) {
diff --git a/wifi_provider.cc b/wifi_provider.cc
index 34fc88b..3b3b11f 100644
--- a/wifi_provider.cc
+++ b/wifi_provider.cc
@@ -13,9 +13,9 @@
#include <base/bind.h>
#include <base/format_macros.h>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
#include "shill/error.h"
#include "shill/event_dispatcher.h"
@@ -33,6 +33,7 @@
using base::Bind;
using base::SplitString;
+using base::StringPrintf;
using std::set;
using std::string;
using std::vector;
diff --git a/wifi_provider_unittest.cc b/wifi_provider_unittest.cc
index c6c404b..ddd2b00 100644
--- a/wifi_provider_unittest.cc
+++ b/wifi_provider_unittest.cc
@@ -10,9 +10,9 @@
#include <vector>
#include <base/format_macros.h>
-#include <base/string_number_conversions.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <gtest/gtest.h>
@@ -29,6 +29,7 @@
#include "shill/wifi_endpoint.h"
#include "shill/wpa_supplicant.h"
+using base::StringPrintf;
using std::map;
using std::set;
using std::string;
diff --git a/wifi_service.cc b/wifi_service.cc
index ab9d337..9b5666d 100644
--- a/wifi_service.cc
+++ b/wifi_service.cc
@@ -9,10 +9,10 @@
#include <string>
#include <utility>
-#include <base/stringprintf.h>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
+#include <base/strings/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include <dbus/dbus.h>
@@ -570,9 +570,10 @@
} else if (security_ == kSecurityPsk ||
security_ == kSecurityRsn ||
security_ == kSecurityWpa) {
- const string psk_proto = StringPrintf("%s %s",
- WPASupplicant::kSecurityModeWPA,
- WPASupplicant::kSecurityModeRSN);
+ const string psk_proto =
+ base::StringPrintf("%s %s",
+ WPASupplicant::kSecurityModeWPA,
+ WPASupplicant::kSecurityModeRSN);
params[WPASupplicant::kPropertySecurityProtocol].writer().
append_string(psk_proto.c_str());
params[WPASupplicant::kPropertyPreSharedKey].writer().
diff --git a/wifi_service_unittest.cc b/wifi_service_unittest.cc
index 76242da..82933b5 100644
--- a/wifi_service_unittest.cc
+++ b/wifi_service_unittest.cc
@@ -9,9 +9,9 @@
#include <string>
#include <vector>
-#include <base/stringprintf.h>
-#include <base/string_number_conversions.h>
-#include <base/string_util.h>
+#include <base/strings/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/wifi_unittest.cc b/wifi_unittest.cc
index 75297ad..cda3d5b 100644
--- a/wifi_unittest.cc
+++ b/wifi_unittest.cc
@@ -16,10 +16,10 @@
#include <base/file_util.h>
#include <base/memory/ref_counted.h>
#include <base/memory/scoped_ptr.h>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include <dbus-c++/dbus.h>
@@ -68,8 +68,8 @@
#include "shill/wifi_service.h"
#include "shill/wpa_supplicant.h"
-
using base::FilePath;
+using base::StringPrintf;
using std::map;
using std::string;
using std::vector;
@@ -432,10 +432,10 @@
string *bssid) {
bss_counter_++;
if (!use_ssid) {
- *ssid = base::StringPrintf("ssid%d", bss_counter_);
+ *ssid = StringPrintf("ssid%d", bss_counter_);
}
- *path = base::StringPrintf("/interface/bss%d", bss_counter_);
- *bssid = base::StringPrintf("00:00:00:00:00:%02x", bss_counter_);
+ *path = StringPrintf("/interface/bss%d", bss_counter_);
+ *bssid = StringPrintf("00:00:00:00:00:%02x", bss_counter_);
WiFiEndpointRefPtr endpoint = MakeEndpointWithMode(*ssid, *bssid, mode);
EXPECT_CALL(wifi_provider_,
OnEndpointAdded(EndpointMatch(endpoint))).Times(1);
@@ -932,7 +932,7 @@
{
string bssid_nosep;
vector<uint8_t> bssid_bytes;
- RemoveChars(bssid, ":", &bssid_nosep);
+ base::RemoveChars(bssid, ":", &bssid_nosep);
base::HexStringToBytes(bssid_nosep, &bssid_bytes);
DBus::MessageIter writer(bss_properties["BSSID"].writer());
diff --git a/wimax.cc b/wimax.cc
index 52a0a30..d10bf36 100644
--- a/wimax.cc
+++ b/wimax.cc
@@ -5,8 +5,8 @@
#include "shill/wimax.h"
#include <base/bind.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include "shill/key_value_store.h"
#include "shill/logging.h"
diff --git a/wimax_provider.cc b/wimax_provider.cc
index 80a3b98..c49a266 100644
--- a/wimax_provider.cc
+++ b/wimax_provider.cc
@@ -8,7 +8,7 @@
#include <set>
#include <base/bind.h>
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/error.h"
diff --git a/wimax_provider_unittest.cc b/wimax_provider_unittest.cc
index df76ee3..d9534c0 100644
--- a/wimax_provider_unittest.cc
+++ b/wimax_provider_unittest.cc
@@ -9,7 +9,7 @@
#include <base/file_util.h>
#include <base/files/scoped_temp_dir.h>
-#include <base/stringprintf.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/eap_credentials.h"
@@ -42,7 +42,7 @@
namespace {
string GetTestLinkName(int index) {
- return StringPrintf("wm%d", index);
+ return base::StringPrintf("wm%d", index);
}
string GetTestPath(int index) {
diff --git a/wimax_service.cc b/wimax_service.cc
index c6b6fb4..ba5be7e 100644
--- a/wimax_service.cc
+++ b/wimax_service.cc
@@ -6,9 +6,9 @@
#include <algorithm>
-#include <base/string_number_conversions.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/dbus_adaptor.h"
diff --git a/wimax_service_unittest.cc b/wimax_service_unittest.cc
index 546b7aa..5fba850 100644
--- a/wimax_service_unittest.cc
+++ b/wimax_service_unittest.cc
@@ -4,7 +4,7 @@
#include "shill/wimax_service.h"
-#include <base/string_util.h>
+#include <base/strings/string_util.h>
#include <chromeos/dbus/service_constants.h>
#include <gtest/gtest.h>
diff --git a/wpa_supplicant.cc b/wpa_supplicant.cc
index 679a277..a41ac63 100644
--- a/wpa_supplicant.cc
+++ b/wpa_supplicant.cc
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include <base/file_path.h>
+#include <base/files/file_path.h>
#include "shill/certificate_file.h"
#include "shill/eap_credentials.h"