From d88fdb324360f59b2d647f3904b6b99cc9d421f0 Mon Sep 17 00:00:00 2001 From: "tedvessenes@gmail.com" Date: Thu, 12 Jan 2012 21:32:44 +0000 Subject: 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 --- chrome/browser/status_icons/desktop_notification_balloon.cc | 10 ++++++---- chrome/browser/sync/engine/sync_scheduler.cc | 10 +++++----- chrome/browser/sync/engine/sync_scheduler.h | 4 ++-- chrome/browser/sync/glue/session_model_associator.cc | 4 ++-- chrome/browser/sync/notifier/chrome_system_resources.cc | 4 ++-- chrome/browser/sync/profile_sync_service_harness.cc | 2 +- 6 files changed, 18 insertions(+), 16 deletions(-) (limited to 'chrome') 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()) { -- cgit v1.1