aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Vakulenko <avakulenko@google.com>2016-01-21 00:08:59 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-01-21 00:08:59 +0000
commit254a3bf66951adafa74c1ac5608db5a46f602e8a (patch)
treeeca0962a89677999c64e0362789da44fbdedea35
parentac45dcc6ab3e2f7d1e522b3e997363515ca41e20 (diff)
parent80b7ee94e36e2d25a97a262d3b558bbf130c2a01 (diff)
downloadplatform_external_libbrillo-254a3bf66951adafa74c1ac5608db5a46f602e8a.tar.gz
platform_external_libbrillo-254a3bf66951adafa74c1ac5608db5a46f602e8a.tar.bz2
platform_external_libbrillo-254a3bf66951adafa74c1ac5608db5a46f602e8a.zip
libbrillo: Update libchrome APIs to r369476
am: 80b7ee94e3 * commit '80b7ee94e36e2d25a97a262d3b558bbf130c2a01': libbrillo: Update libchrome APIs to r369476
-rw-r--r--brillo/backoff_entry.cc4
-rw-r--r--brillo/backoff_entry.h4
-rw-r--r--brillo/dbus/dbus_method_invoker.h2
-rw-r--r--brillo/dbus/dbus_method_invoker_unittest.cc2
-rw-r--r--brillo/dbus/dbus_object.cc2
-rw-r--r--brillo/key_value_store.cc10
-rw-r--r--brillo/message_loops/base_message_loop.cc5
-rw-r--r--brillo/mime_utils.cc2
8 files changed, 16 insertions, 15 deletions
diff --git a/brillo/backoff_entry.cc b/brillo/backoff_entry.cc
index acef714..8b36287 100644
--- a/brillo/backoff_entry.cc
+++ b/brillo/backoff_entry.cc
@@ -75,7 +75,7 @@ bool BackoffEntry::CanDiscard() const {
base::TimeTicks now = ImplGetTimeNow();
- int64 unused_since_ms =
+ int64_t unused_since_ms =
(now - exponential_backoff_release_time_).InMilliseconds();
// Release time is further than now, we are managing it.
@@ -153,7 +153,7 @@ base::TimeTicks BackoffEntry::CalculateReleaseTime() const {
// Decide between maximum release time and calculated release time, accounting
// for overflow with both.
- int64 release_time_us = std::min(
+ int64_t release_time_us = std::min(
calculated_release_time_us.ValueOrDefault(kMaxTime),
maximum_release_time_us.ValueOrDefault(kMaxTime));
diff --git a/brillo/backoff_entry.h b/brillo/backoff_entry.h
index 08e1e40..82cc953 100644
--- a/brillo/backoff_entry.h
+++ b/brillo/backoff_entry.h
@@ -39,11 +39,11 @@ class BRILLO_EXPORT BackoffEntry {
// Maximum amount of time we are willing to delay our request, -1
// for no maximum.
- int64 maximum_backoff_ms;
+ int64_t maximum_backoff_ms;
// Time to keep an entry from being discarded even when it
// has no significant state, -1 to never discard.
- int64 entry_lifetime_ms;
+ int64_t entry_lifetime_ms;
// If true, we always use a delay of initial_delay_ms, even before
// we've seen num_errors_to_ignore errors. Otherwise, initial_delay_ms
diff --git a/brillo/dbus/dbus_method_invoker.h b/brillo/dbus/dbus_method_invoker.h
index 1b6d809..e78fd02 100644
--- a/brillo/dbus/dbus_method_invoker.h
+++ b/brillo/dbus/dbus_method_invoker.h
@@ -158,7 +158,7 @@ inline const T& HackMove(const T& val) {
// safe to move the file descriptor out of |val|. That's why we are doing
// const_cast here. It is a bit hacky, but there is no negative side effects.
inline dbus::FileDescriptor HackMove(const dbus::FileDescriptor& val) {
- return const_cast<dbus::FileDescriptor&>(val).Pass();
+ return std::move(const_cast<dbus::FileDescriptor&>(val));
}
} // namespace internal
diff --git a/brillo/dbus/dbus_method_invoker_unittest.cc b/brillo/dbus/dbus_method_invoker_unittest.cc
index 9207932..cbd7065 100644
--- a/brillo/dbus/dbus_method_invoker_unittest.cc
+++ b/brillo/dbus/dbus_method_invoker_unittest.cc
@@ -140,7 +140,7 @@ class DBusMethodInvokerTest : public testing::Test {
dbus::FileDescriptor fd_out;
using brillo::dbus_utils::ExtractMethodCallResults;
EXPECT_TRUE(ExtractMethodCallResults(response.get(), nullptr, &fd_out));
- return fd_out.Pass();
+ return fd_out;
}
scoped_refptr<dbus::MockBus> bus_;
diff --git a/brillo/dbus/dbus_object.cc b/brillo/dbus/dbus_object.cc
index d4e982a..95cccdd 100644
--- a/brillo/dbus/dbus_object.cc
+++ b/brillo/dbus/dbus_object.cc
@@ -122,7 +122,7 @@ void DBusInterface::HandleMethodCall(dbus::MethodCall* method_call,
dbus::ErrorResponse::FromMethodCall(method_call,
DBUS_ERROR_UNKNOWN_METHOD,
"Unknown method: " + method_name);
- sender.Run(response.Pass());
+ sender.Run(std::move(response));
return;
}
VLOG(1) << "Dispatching DBus method call: " << method_name;
diff --git a/brillo/key_value_store.cc b/brillo/key_value_store.cc
index 2efa50e..7840427 100644
--- a/brillo/key_value_store.cc
+++ b/brillo/key_value_store.cc
@@ -30,7 +30,7 @@ const char kFalseValue[] = "false";
// Returns a copy of |key| with leading and trailing whitespace removed.
string TrimKey(const string& key) {
string trimmed_key;
- base::TrimWhitespace(key, base::TRIM_ALL, &trimmed_key);
+ base::TrimWhitespaceASCII(key, base::TRIM_ALL, &trimmed_key);
CHECK(!trimmed_key.empty());
return trimmed_key;
}
@@ -46,11 +46,11 @@ bool KeyValueStore::Load(const base::FilePath& path) {
bool KeyValueStore::LoadFromString(const std::string& data) {
// Split along '\n', then along '='.
- vector<string> lines;
- base::SplitStringDontTrim(data, '\n', &lines);
+ vector<string> lines = base::SplitString(data, "\n", base::KEEP_WHITESPACE,
+ base::SPLIT_WANT_ALL);
for (auto it = lines.begin(); it != lines.end(); ++it) {
std::string line;
- base::TrimWhitespace(*it, base::TRIM_LEADING, &line);
+ base::TrimWhitespaceASCII(*it, base::TRIM_LEADING, &line);
if (line.empty() || line.front() == '#')
continue;
@@ -59,7 +59,7 @@ bool KeyValueStore::LoadFromString(const std::string& data) {
if (!string_utils::SplitAtFirst(line, "=", &key, &value, false))
return false;
- base::TrimWhitespace(key, base::TRIM_TRAILING, &key);
+ base::TrimWhitespaceASCII(key, base::TRIM_TRAILING, &key);
if (key.empty())
return false;
diff --git a/brillo/message_loops/base_message_loop.cc b/brillo/message_loops/base_message_loop.cc
index 1886569..9bd7191 100644
--- a/brillo/message_loops/base_message_loop.cc
+++ b/brillo/message_loops/base_message_loop.cc
@@ -268,8 +268,9 @@ int BaseMessageLoop::ParseBinderMinor(
int result = kInvalidMinor;
// Split along '\n', then along the ' '. Note that base::SplitString trims all
// white spaces at the beginning and end after splitting.
- std::vector<std::string> lines;
- base::SplitString(file_contents, '\n', &lines);
+ std::vector<std::string> lines =
+ base::SplitString(file_contents, "\n", base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
for (const std::string& line : lines) {
if (line.empty())
continue;
diff --git a/brillo/mime_utils.cc b/brillo/mime_utils.cc
index f194cd2..d98eb43 100644
--- a/brillo/mime_utils.cc
+++ b/brillo/mime_utils.cc
@@ -154,7 +154,7 @@ std::string mime::GetParameterValue(const std::string& mime_string,
const std::string& paramName) {
mime::Parameters params = mime::GetParameters(mime_string);
for (const auto& pair : params) {
- if (base::strcasecmp(pair.first.c_str(), paramName.c_str()) == 0)
+ if (base::EqualsCaseInsensitiveASCII(pair.first.c_str(), paramName.c_str()))
return pair.second;
}
return std::string();