summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorlambroslambrou@google.com <lambroslambrou@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-12 22:49:24 +0000
committerlambroslambrou@google.com <lambroslambrou@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-12 22:49:24 +0000
commit6d41f89c6d1fc29fc8846ee1abdd8d70e3c56067 (patch)
tree906bb1b77629cf35fc6141a80caf9cca74587826 /chrome
parentbf70ff744afe295bc48c5407ea1a3832d5050917 (diff)
downloadchromium_src-6d41f89c6d1fc29fc8846ee1abdd8d70e3c56067.zip
chromium_src-6d41f89c6d1fc29fc8846ee1abdd8d70e3c56067.tar.gz
chromium_src-6d41f89c6d1fc29fc8846ee1abdd8d70e3c56067.tar.bz2
Revert 117531 - Convert use of int ms to TimeDelta in files owned by ajwong.
R=ajwong@chromium.org BUG=108171 TEST= Review URL: http://codereview.chromium.org/9187023 TBR=tedvessenes@gmail.com Review URL: http://codereview.chromium.org/9187072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117539 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/service/cloud_print/cloud_print_auth.cc6
-rw-r--r--chrome/service/cloud_print/cloud_print_proxy_backend.cc8
-rw-r--r--chrome/service/cloud_print/print_system_cups.cc29
-rw-r--r--chrome/service/service_process.cc4
4 files changed, 23 insertions, 24 deletions
diff --git a/chrome/service/cloud_print/cloud_print_auth.cc b/chrome/service/cloud_print/cloud_print_auth.cc
index 53e263d..ac757f6 100644
--- a/chrome/service/cloud_print/cloud_print_auth.cc
+++ b/chrome/service/cloud_print/cloud_print_auth.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -137,8 +137,8 @@ void CloudPrintAuth::OnRefreshTokenResponse(const std::string& access_token,
// Schedule a task to refresh the access token again when it is about to
// expire.
DCHECK(expires_in_seconds > kTokenRefreshGracePeriodSecs);
- base::TimeDelta refresh_delay = base::TimeDelta::FromSeconds(
- expires_in_seconds - kTokenRefreshGracePeriodSecs);
+ int64 refresh_delay =
+ (expires_in_seconds - kTokenRefreshGracePeriodSecs)*1000;
MessageLoop::current()->PostDelayedTask(
FROM_HERE, base::Bind(&CloudPrintAuth::RefreshAccessToken, this),
refresh_delay);
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
index 21c5c00..4b02dd8 100644
--- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -399,12 +399,12 @@ void CloudPrintProxyBackend::Core::PollForJobs() {
void CloudPrintProxyBackend::Core::ScheduleJobPoll() {
if (!job_poll_scheduled_) {
- base::TimeDelta interval = base::TimeDelta::FromSeconds(
- base::RandInt(kMinJobPollIntervalSecs, kMaxJobPollIntervalSecs));
+ int interval_in_seconds = base::RandInt(kMinJobPollIntervalSecs,
+ kMaxJobPollIntervalSecs);
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&CloudPrintProxyBackend::Core::PollForJobs, this),
- interval);
+ interval_in_seconds * 1000);
job_poll_scheduled_ = true;
}
}
diff --git a/chrome/service/cloud_print/print_system_cups.cc b/chrome/service/cloud_print/print_system_cups.cc
index bb4dd56..1371a0b 100644
--- a/chrome/service/cloud_print/print_system_cups.cc
+++ b/chrome/service/cloud_print/print_system_cups.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -48,11 +48,10 @@ static const char kCUPSNotifyDelete[] = "notify_delete";
static const int kDefaultIPPServerPort = 631;
// Time interval to check for printer's updates.
-const base::TimeDelta kCheckForPrinterUpdates =
- base::TimeDelta::FromMinutes(5);
+const int kCheckForPrinterUpdatesMs = 5*60*1000;
// Job update timeout
-const base::TimeDelta kJobUpdateTimeout = base::TimeDelta::FromSeconds(5);
+const int kJobUpdateTimeoutMs = 5000;
// Job id for dry run (it should not affect CUPS job ids, since 0 job-id is
// invalid in CUPS.
@@ -115,7 +114,7 @@ class PrintSystemCUPS : public PrintSystem {
const std::string& printer_name,
printing::PrinterCapsAndDefaults* printer_info);
- base::TimeDelta GetUpdateTimeout() const {
+ int GetUpdateTimeoutMs() const {
return update_timeout_;
}
@@ -159,7 +158,7 @@ class PrintSystemCUPS : public PrintSystem {
typedef std::list<PrintServerInfoCUPS> PrintServerList;
PrintServerList print_servers_;
- base::TimeDelta update_timeout_;
+ int update_timeout_;
bool initialized_;
bool printer_enum_succeeded_;
bool notify_delete_;
@@ -184,7 +183,7 @@ class PrintServerWatcherCUPS
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PrintServerWatcherCUPS::CheckForUpdates, this),
- print_system_->GetUpdateTimeout());
+ print_system_->GetUpdateTimeoutMs());
return true;
}
@@ -205,7 +204,7 @@ class PrintServerWatcherCUPS
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PrintServerWatcherCUPS::CheckForUpdates, this),
- print_system_->GetUpdateTimeout());
+ print_system_->GetUpdateTimeoutMs());
}
private:
@@ -259,13 +258,13 @@ class PrinterWatcherCUPS
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PrinterWatcherCUPS::JobStatusUpdate, this),
- kJobUpdateTimeout);
+ kJobUpdateTimeoutMs);
// Schedule next printer check.
// TODO(gene): Randomize time for the next printer update.
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PrinterWatcherCUPS::PrinterUpdate, this),
- print_system_->GetUpdateTimeout());
+ print_system_->GetUpdateTimeoutMs());
return true;
}
@@ -290,7 +289,7 @@ class PrinterWatcherCUPS
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PrinterWatcherCUPS::JobStatusUpdate, this),
- kJobUpdateTimeout);
+ kJobUpdateTimeoutMs);
}
void PrinterUpdate() {
@@ -312,7 +311,7 @@ class PrinterWatcherCUPS
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PrinterWatcherCUPS::PrinterUpdate, this),
- print_system_->GetUpdateTimeout());
+ print_system_->GetUpdateTimeoutMs());
}
private:
@@ -390,14 +389,14 @@ class JobSpoolerCUPS : public PrintSystem::JobSpooler {
};
PrintSystemCUPS::PrintSystemCUPS(const DictionaryValue* print_system_settings)
- : update_timeout_(kCheckForPrinterUpdates),
+ : update_timeout_(kCheckForPrinterUpdatesMs),
initialized_(false),
printer_enum_succeeded_(false),
notify_delete_(true) {
if (print_system_settings) {
int timeout;
if (print_system_settings->GetInteger(kCUPSUpdateTimeoutMs, &timeout))
- update_timeout_ = base::TimeDelta::FromMilliseconds(timeout);
+ update_timeout_ = timeout;
bool notify_delete = true;
if (print_system_settings->GetBoolean(kCUPSNotifyDelete, &notify_delete))
@@ -469,7 +468,7 @@ void PrintSystemCUPS::UpdatePrinters() {
// Schedule next update.
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- base::Bind(&PrintSystemCUPS::UpdatePrinters, this), GetUpdateTimeout());
+ base::Bind(&PrintSystemCUPS::UpdatePrinters, this), GetUpdateTimeoutMs());
}
PrintSystem::PrintSystemResult PrintSystemCUPS::EnumeratePrinters(
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc
index 7a191b6..d2fa127 100644
--- a/chrome/service/service_process.cc
+++ b/chrome/service/service_process.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -45,7 +45,7 @@ namespace {
// Delay in millseconds after the last service is disabled before we attempt
// a shutdown.
-const base::TimeDelta kShutdownDelay = base::TimeDelta::FromMinutes(1);
+const int64 kShutdownDelay = 60000;
const char kDefaultServiceProcessLocale[] = "en-US";