summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Vakulenko <avakulenko@google.com>2016-01-20 07:53:12 -0800
committerIan Pedowitz <ijpedowitz@google.com>2016-01-20 17:18:47 -0800
commitfca478e3db86521918313d3d92290b1928de3702 (patch)
treefa85ef562dc125c933dc3086aa60548f91e3eb7a
parentd5eceb53b2b8b2ef5b0c4115ff1632b077201734 (diff)
downloadapmanager-fca478e3db86521918313d3d92290b1928de3702.tar.gz
apmanager: Update libchrome APIs to r369476
The new libchrome has been ported from Chromium and some APIs have changed. Make necessary changes at call sites. (cherry picked from commit 33a54245a627a89089cd470b2564d04dbe9833ff) Change-Id: Ie449b7b706bfcef332a4306e93d7d1b1bd5ccf52
-rw-r--r--config_unittest.cc4
-rw-r--r--event_dispatcher.cc12
-rw-r--r--service_unittest.cc4
3 files changed, 13 insertions, 7 deletions
diff --git a/config_unittest.cc b/config_unittest.cc
index 3bc380b..59516af 100644
--- a/config_unittest.cc
+++ b/config_unittest.cc
@@ -150,8 +150,8 @@ class ConfigTest : public testing::Test {
Error::Type expected_type,
const std::string& expected_message_start) {
EXPECT_EQ(expected_type, error.type());
- EXPECT_TRUE(
- base::StartsWithASCII(error.message(), expected_message_start, false));
+ EXPECT_TRUE(base::StartsWith(error.message(), expected_message_start,
+ base::CompareCase::INSENSITIVE_ASCII));
}
protected:
diff --git a/event_dispatcher.cc b/event_dispatcher.cc
index bd36d4a..5e7d831 100644
--- a/event_dispatcher.cc
+++ b/event_dispatcher.cc
@@ -17,7 +17,7 @@
#include "apmanager/event_dispatcher.h"
#include <base/location.h>
-#include <base/message_loop/message_loop_proxy.h>
+#include <base/message_loop/message_loop.h>
#include <base/time/time.h>
namespace apmanager {
@@ -37,13 +37,19 @@ EventDispatcher* EventDispatcher::GetInstance() {
}
bool EventDispatcher::PostTask(const base::Closure& task) {
- return base::MessageLoopProxy::current()->PostTask(FROM_HERE, task);
+ if (!base::MessageLoop::current())
+ return false;
+ base::MessageLoop::current()->PostTask(FROM_HERE, task);
+ return true;
}
bool EventDispatcher::PostDelayedTask(const base::Closure& task,
int64_t delay_ms) {
- return base::MessageLoopProxy::current()->PostDelayedTask(
+ if (!base::MessageLoop::current())
+ return false;
+ base::MessageLoop::current()->PostDelayedTask(
FROM_HERE, task, base::TimeDelta::FromMilliseconds(delay_ms));
+ return true;
}
} // namespace apmanager
diff --git a/service_unittest.cc b/service_unittest.cc
index 34d8721..80da773 100644
--- a/service_unittest.cc
+++ b/service_unittest.cc
@@ -105,8 +105,8 @@ class ServiceTest : public testing::Test {
Error::Type expected_type,
const std::string& expected_message_start) {
EXPECT_EQ(expected_type, error.type());
- EXPECT_TRUE(
- base::StartsWithASCII(error.message(), expected_message_start, false));
+ EXPECT_TRUE(base::StartsWith(error.message(), expected_message_start,
+ base::CompareCase::INSENSITIVE_ASCII));
}
protected: