summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-12 21:32:44 +0000
committertedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-12 21:32:44 +0000
commitd88fdb324360f59b2d647f3904b6b99cc9d421f0 (patch)
treee76328f6a0776e68c1e139cdad3cf7d90dde3a99 /chrome
parentb41daf5d1bbc35177eac4bd3a2312b9750275c11 (diff)
downloadchromium_src-d88fdb324360f59b2d647f3904b6b99cc9d421f0.zip
chromium_src-d88fdb324360f59b2d647f3904b6b99cc9d421f0.tar.gz
chromium_src-d88fdb324360f59b2d647f3904b6b99cc9d421f0.tar.bz2
Convert use of int ms to TimeDelta in files owned by atwilson.
R=atwilson@chromium.org BUG=108171 TEST= Review URL: http://codereview.chromium.org/9107022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117505 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/status_icons/desktop_notification_balloon.cc10
-rw-r--r--chrome/browser/sync/engine/sync_scheduler.cc10
-rw-r--r--chrome/browser/sync/engine/sync_scheduler.h4
-rw-r--r--chrome/browser/sync/glue/session_model_associator.cc4
-rw-r--r--chrome/browser/sync/notifier/chrome_system_resources.cc4
-rw-r--r--chrome/browser/sync/profile_sync_service_harness.cc2
6 files changed, 18 insertions, 16 deletions
diff --git a/chrome/browser/status_icons/desktop_notification_balloon.cc b/chrome/browser/status_icons/desktop_notification_balloon.cc
index 4f1777a..a0361d4 100644
--- a/chrome/browser/status_icons/desktop_notification_balloon.cc
+++ b/chrome/browser/status_icons/desktop_notification_balloon.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -26,7 +26,7 @@ void CloseBalloon(const std::string& id) {
const char kNotificationPrefix[] = "desktop_notification_balloon.";
// Timeout for automatically dismissing the notification balloon.
-const size_t kTimeoutMilliseconds = 6000;
+const size_t kTimeoutSeconds = 6;
class DummyNotificationDelegate : public NotificationDelegate {
public:
@@ -35,8 +35,10 @@ class DummyNotificationDelegate : public NotificationDelegate {
virtual ~DummyNotificationDelegate() {}
virtual void Display() OVERRIDE {
- MessageLoop::current()->PostDelayedTask(FROM_HERE,
- base::Bind(&CloseBalloon, id()), kTimeoutMilliseconds);
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&CloseBalloon, id()),
+ base::TimeDelta::FromSeconds(kTimeoutSeconds));
}
virtual void Error() OVERRIDE {}
virtual void Close(bool by_user) OVERRIDE {}
diff --git a/chrome/browser/sync/engine/sync_scheduler.cc b/chrome/browser/sync/engine/sync_scheduler.cc
index 241692e..8ba1959 100644
--- a/chrome/browser/sync/engine/sync_scheduler.cc
+++ b/chrome/browser/sync/engine/sync_scheduler.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -677,15 +677,15 @@ void SyncScheduler::PostTask(
void SyncScheduler::PostDelayedTask(
const tracked_objects::Location& from_here,
- const char* name, const base::Closure& task, int64 delay_ms) {
+ const char* name, const base::Closure& task, base::TimeDelta delay) {
SDVLOG_LOC(from_here, 3) << "Posting " << name << " task with "
- << delay_ms << " ms delay";
+ << delay.InMilliseconds() << " ms delay";
DCHECK_EQ(MessageLoop::current(), sync_loop_);
if (!started_) {
SDVLOG(1) << "Not posting task as scheduler is stopped.";
return;
}
- sync_loop_->PostDelayedTask(from_here, task, delay_ms);
+ sync_loop_->PostDelayedTask(from_here, task, delay);
}
void SyncScheduler::ScheduleSyncSessionJob(const SyncSessionJob& job) {
@@ -708,7 +708,7 @@ void SyncScheduler::ScheduleSyncSessionJob(const SyncSessionJob& job) {
base::Bind(&SyncScheduler::DoSyncSessionJob,
weak_ptr_factory_.GetWeakPtr(),
job),
- delay.InMilliseconds());
+ delay);
}
void SyncScheduler::SetSyncerStepsForPurpose(
diff --git a/chrome/browser/sync/engine/sync_scheduler.h b/chrome/browser/sync/engine/sync_scheduler.h
index 24b9968..4b1593b 100644
--- a/chrome/browser/sync/engine/sync_scheduler.h
+++ b/chrome/browser/sync/engine/sync_scheduler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -252,7 +252,7 @@ class SyncScheduler : public sessions::SyncSession::Delegate,
void PostDelayedTask(const tracked_objects::Location& from_here,
const char* name,
const base::Closure& task,
- int64 delay_ms);
+ base::TimeDelta delay);
// Helper to assemble a job and post a delayed task to sync.
void ScheduleSyncSessionJob(const SyncSessionJob& job);
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc
index 0a32957..0ecdf53 100644
--- a/chrome/browser/sync/glue/session_model_associator.cc
+++ b/chrome/browser/sync/glue/session_model_associator.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -1096,7 +1096,7 @@ void SessionModelAssociator::BlockUntilLocalChangeForTest(
FROM_HERE,
base::Bind(&SessionModelAssociator::QuitLoopForSubtleTesting,
test_weak_factory_.GetWeakPtr()),
- timeout_milliseconds);
+ base::TimeDelta::FromMilliseconds(timeout_milliseconds));
}
// ==========================================================================
diff --git a/chrome/browser/sync/notifier/chrome_system_resources.cc b/chrome/browser/sync/notifier/chrome_system_resources.cc
index 71d24da..9d46c73 100644
--- a/chrome/browser/sync/notifier/chrome_system_resources.cc
+++ b/chrome/browser/sync/notifier/chrome_system_resources.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -99,7 +99,7 @@ void ChromeScheduler::Schedule(invalidation::TimeDelta delay,
MessageLoop::current()->PostDelayedTask(
FROM_HERE, base::Bind(&ChromeScheduler::RunPostedTask,
weak_factory_.GetWeakPtr(), task),
- delay.InMillisecondsRoundedUp());
+ delay);
}
bool ChromeScheduler::IsRunningOnThread() const {
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index ff64bd0..d403396 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -744,7 +744,7 @@ bool ProfileSyncServiceHarness::AwaitStatusChangeWithTimeout(
FROM_HERE,
base::Bind(&StateChangeTimeoutEvent::Callback,
timeout_signal.get()),
- timeout_milliseconds);
+ base::TimeDelta::FromMilliseconds(timeout_milliseconds));
loop->Run();
loop->SetNestableTasksAllowed(did_allow_nestable_tasks);
if (timeout_signal->Abort()) {