Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1852)

Unified Diff: dbus/bus.cc

Issue 9582044: Convert uses of int ms to TimeDelta in dbus. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix mock PostDelayedTask function interface. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dbus/bus.h ('k') | dbus/end_to_end_async_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/bus.cc
diff --git a/dbus/bus.cc b/dbus/bus.cc
index 3b2f059c5975cad4ac06e92245e758320db1a52a..617f34ba54e6094462d48e935761ddfba6bb7998 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.
@@ -611,16 +612,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";
}
}
« no previous file with comments | « dbus/bus.h ('k') | dbus/end_to_end_async_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698