summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 17:23:51 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 17:23:51 +0000
commit743ace4213ae3ea93355dff8b57ef33287b32220 (patch)
treee39fc30e436e0a06790d665878cd91113ba180d4 /chrome
parent8c14a436fe6488c8f647ff79301102e885838c77 (diff)
downloadchromium_src-743ace4213ae3ea93355dff8b57ef33287b32220.zip
chromium_src-743ace4213ae3ea93355dff8b57ef33287b32220.tar.gz
chromium_src-743ace4213ae3ea93355dff8b57ef33287b32220.tar.bz2
Consistently use int64 for integers holding number of milliseconds.
This applies only to things which use TimeDelta::InMilliseconds, because it returns int64. Before this patch callers static_casted that to int, and after this patch they use the returned value as int64. Review URL: http://codereview.chromium.org/126279 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/history/expire_history_backend.cc3
-rw-r--r--chrome/browser/metrics/metrics_service.cc2
-rw-r--r--chrome/browser/net/url_fetcher.cc2
-rw-r--r--chrome/browser/net/url_fetcher_protect.cc4
-rw-r--r--chrome/browser/net/url_fetcher_protect.h2
-rw-r--r--chrome/test/chrome_process_util.cc3
6 files changed, 7 insertions, 9 deletions
diff --git a/chrome/browser/history/expire_history_backend.cc b/chrome/browser/history/expire_history_backend.cc
index 070722bc..084fa61 100644
--- a/chrome/browser/history/expire_history_backend.cc
+++ b/chrome/browser/history/expire_history_backend.cc
@@ -416,8 +416,7 @@ void ExpireHistoryBackend::ArchiveURLsAndVisits(
void ExpireHistoryBackend::ScheduleArchive(TimeDelta delay) {
factory_.RevokeAll();
MessageLoop::current()->PostDelayedTask(FROM_HERE, factory_.NewRunnableMethod(
- &ExpireHistoryBackend::DoArchiveIteration),
- static_cast<int>(delay.InMilliseconds()));
+ &ExpireHistoryBackend::DoArchiveIteration), delay.InMilliseconds());
}
void ExpireHistoryBackend::DoArchiveIteration() {
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index fa4d1db..50b3af3 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -912,7 +912,7 @@ void MetricsService::StartLogTransmissionTimer() {
MessageLoop::current()->PostDelayedTask(FROM_HERE,
log_sender_factory_.
NewRunnableMethod(&MetricsService::LogTransmissionTimerDone),
- static_cast<int>(interlog_duration_.InMilliseconds()));
+ interlog_duration_.InMilliseconds());
}
void MetricsService::LogTransmissionTimerDone() {
diff --git a/chrome/browser/net/url_fetcher.cc b/chrome/browser/net/url_fetcher.cc
index 425cc73..4783aea8 100644
--- a/chrome/browser/net/url_fetcher.cc
+++ b/chrome/browser/net/url_fetcher.cc
@@ -254,7 +254,7 @@ void URLFetcher::Core::OnCompletedURLRequest(const URLRequestStatus& status) {
if (response_code_ >= 500) {
// When encountering a server error, we will send the request again
// after backoff time.
- const int wait =
+ const int64 wait =
protect_entry_->UpdateBackoff(URLFetcherProtectEntry::FAILURE);
++num_retries_;
// Restarts the request if we still need to notify the delegate.
diff --git a/chrome/browser/net/url_fetcher_protect.cc b/chrome/browser/net/url_fetcher_protect.cc
index 22292ab..8798b5a 100644
--- a/chrome/browser/net/url_fetcher_protect.cc
+++ b/chrome/browser/net/url_fetcher_protect.cc
@@ -52,7 +52,7 @@ URLFetcherProtectEntry::URLFetcherProtectEntry(int sliding_window_period,
ResetBackoff();
}
-int URLFetcherProtectEntry::UpdateBackoff(EventType event_type) {
+int64 URLFetcherProtectEntry::UpdateBackoff(EventType event_type) {
// request may be sent in different threads
AutoLock lock(lock_);
@@ -71,7 +71,7 @@ int URLFetcherProtectEntry::UpdateBackoff(EventType event_type) {
NOTREACHED();
}
- int wait = static_cast<int>(t.InMilliseconds());
+ int64 wait = t.InMilliseconds();
DCHECK(wait >= 0);
return wait;
}
diff --git a/chrome/browser/net/url_fetcher_protect.h b/chrome/browser/net/url_fetcher_protect.h
index 7352932..9b121b7 100644
--- a/chrome/browser/net/url_fetcher_protect.h
+++ b/chrome/browser/net/url_fetcher_protect.h
@@ -53,7 +53,7 @@ class URLFetcherProtectEntry {
// the timeout period. It returns the backoff time, in milliseconds, that
// indicates to the sender how long should it wait before sending the request.
// If the request is allowed to be sent immediately, the backoff time is 0.
- int UpdateBackoff(EventType event_type);
+ int64 UpdateBackoff(EventType event_type);
// Returns the max retries allowed.
int max_retries() const {
diff --git a/chrome/test/chrome_process_util.cc b/chrome/test/chrome_process_util.cc
index 9d858e4..8ad6239 100644
--- a/chrome/test/chrome_process_util.cc
+++ b/chrome/test/chrome_process_util.cc
@@ -42,8 +42,7 @@ void TerminateAllChromeProcesses(const FilePath& data_dir) {
for (it = handles.begin();
it != handles.end() && Time::Now() - start < kExitTimeout;
++it) {
- // TODO(phajdan.jr): Fix int/int64 problems with TimeDelta::InMilliseconds.
- int wait_time_ms = static_cast<int>((Time::Now() - start).InMilliseconds());
+ int64 wait_time_ms = (Time::Now() - start).InMilliseconds();
base::WaitForSingleProcess(*it, wait_time_ms);
}