summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
authortedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-11 01:12:20 +0000
committertedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-11 01:12:20 +0000
commit4b45426889b252dd2094371f8b7b62aaa0220c2d (patch)
tree2db3b96f5bc95f4ce51f60903f550935171301bd /dbus
parent21658d82902a1c89a260744c86909a0cdb7a20c3 (diff)
downloadchromium_src-4b45426889b252dd2094371f8b7b62aaa0220c2d.zip
chromium_src-4b45426889b252dd2094371f8b7b62aaa0220c2d.tar.gz
chromium_src-4b45426889b252dd2094371f8b7b62aaa0220c2d.tar.bz2
Convert uses of int ms to TimeDelta in dbus.
R=satorux@chromium.org BUG=108171 Review URL: http://codereview.chromium.org/9582044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126055 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus')
-rw-r--r--dbus/bus.cc15
-rw-r--r--dbus/bus.h2
-rw-r--r--dbus/end_to_end_async_unittest.cc2
-rw-r--r--dbus/mock_bus.h2
-rw-r--r--dbus/test_service.cc2
5 files changed, 12 insertions, 11 deletions
diff --git a/dbus/bus.cc b/dbus/bus.cc
index e391bc5..9d4a436 100644
--- a/dbus/bus.cc
+++ b/dbus/bus.cc
@@ -117,7 +117,7 @@ class Timeout : public base::RefCountedThreadSafe<Timeout> {
bus->PostDelayedTaskToDBusThread(FROM_HERE,
base::Bind(&Timeout::HandleTimeout,
this),
- GetIntervalInMs());
+ GetInterval());
monitoring_is_active_ = true;
}
@@ -128,9 +128,10 @@ class Timeout : public base::RefCountedThreadSafe<Timeout> {
monitoring_is_active_ = false;
}
- // Returns the interval in milliseconds.
- int GetIntervalInMs() {
- return dbus_timeout_get_interval(raw_timeout_);
+ // Returns the interval.
+ base::TimeDelta GetInterval() {
+ return base::TimeDelta::FromMilliseconds(
+ dbus_timeout_get_interval(raw_timeout_));
}
// Cleans up the raw_timeout and marks that timeout is completed.
@@ -642,16 +643,16 @@ void Bus::PostTaskToDBusThread(const tracked_objects::Location& from_here,
void Bus::PostDelayedTaskToDBusThread(
const tracked_objects::Location& from_here,
const base::Closure& task,
- int delay_ms) {
+ base::TimeDelta delay) {
if (dbus_thread_message_loop_proxy_.get()) {
if (!dbus_thread_message_loop_proxy_->PostDelayedTask(
- from_here, task, delay_ms)) {
+ from_here, task, delay)) {
LOG(WARNING) << "Failed to post a task to the D-Bus thread message loop";
}
} else {
DCHECK(origin_message_loop_proxy_.get());
if (!origin_message_loop_proxy_->PostDelayedTask(
- from_here, task, delay_ms)) {
+ from_here, task, delay)) {
LOG(WARNING) << "Failed to post a task to the origin message loop";
}
}
diff --git a/dbus/bus.h b/dbus/bus.h
index 0cafd9e..2684dcd 100644
--- a/dbus/bus.h
+++ b/dbus/bus.h
@@ -396,7 +396,7 @@ class Bus : public base::RefCountedThreadSafe<Bus> {
virtual void PostDelayedTaskToDBusThread(
const tracked_objects::Location& from_here,
const base::Closure& task,
- int delay_ms);
+ base::TimeDelta delay);
// Returns true if the bus has the D-Bus thread.
virtual bool HasDBusThread();
diff --git a/dbus/end_to_end_async_unittest.cc b/dbus/end_to_end_async_unittest.cc
index 302b7b4..600c83a 100644
--- a/dbus/end_to_end_async_unittest.cc
+++ b/dbus/end_to_end_async_unittest.cc
@@ -314,7 +314,7 @@ TEST_F(EndToEndAsyncTest, EmptyResponseCallback) {
// Post a delayed task to quit the message loop.
message_loop_.PostDelayedTask(FROM_HERE,
MessageLoop::QuitClosure(),
- TestTimeouts::tiny_timeout_ms());
+ TestTimeouts::tiny_timeout());
message_loop_.Run();
// We cannot tell if the empty callback is called, but at least we can
// check if the test does not crash.
diff --git a/dbus/mock_bus.h b/dbus/mock_bus.h
index 88fc084..bc25fb6 100644
--- a/dbus/mock_bus.h
+++ b/dbus/mock_bus.h
@@ -67,7 +67,7 @@ class MockBus : public Bus {
MOCK_METHOD3(PostDelayedTaskToDBusThread, void(
const tracked_objects::Location& from_here,
const base::Closure& task,
- int delay_ms));
+ base::TimeDelta delay));
MOCK_METHOD0(HasDBusThread, bool());
MOCK_METHOD0(AssertOnOriginThread, void());
MOCK_METHOD0(AssertOnDBusThread, void());
diff --git a/dbus/test_service.cc b/dbus/test_service.cc
index 7532d5b..443ad9b 100644
--- a/dbus/test_service.cc
+++ b/dbus/test_service.cc
@@ -243,7 +243,7 @@ void TestService::AsyncEcho(
base::Unretained(this),
method_call,
response_sender),
- TestTimeouts::tiny_timeout_ms());
+ TestTimeouts::tiny_timeout());
}
void TestService::BrokenMethod(