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

Unified Diff: sync/engine/backoff_delay_provider.cc

Issue 1545553003: Switch to standard integer types in sync/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « sync/engine/backoff_delay_provider.h ('k') | sync/engine/commit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/backoff_delay_provider.cc
diff --git a/sync/engine/backoff_delay_provider.cc b/sync/engine/backoff_delay_provider.cc
index ddd90ed8d6c5d4d38c7e84db5bddb22ff621f9f3..cb8b0f198c4488a1127d1452ff0b5f6f373a94f9 100644
--- a/sync/engine/backoff_delay_provider.cc
+++ b/sync/engine/backoff_delay_provider.cc
@@ -4,6 +4,8 @@
#include "sync/engine/backoff_delay_provider.h"
+#include <stdint.h>
+
#include <algorithm>
#include "base/rand_util.h"
@@ -43,8 +45,8 @@ TimeDelta BackoffDelayProvider::GetDelay(const base::TimeDelta& last_delay) {
return TimeDelta::FromSeconds(kMaxBackoffSeconds);
// This calculates approx. base_delay_seconds * 2 +/- base_delay_seconds / 2
- int64 backoff_s =
- std::max(static_cast<int64>(1),
+ int64_t backoff_s =
+ std::max(static_cast<int64_t>(1),
last_delay.InSeconds() * kBackoffRandomizationFactor);
// Flip a coin to randomize backoff interval by +/- 50%.
@@ -55,7 +57,7 @@ TimeDelta BackoffDelayProvider::GetDelay(const base::TimeDelta& last_delay) {
(rand_sign * (last_delay.InSeconds() / kBackoffRandomizationFactor));
// Cap the backoff interval.
- backoff_s = std::max(static_cast<int64>(1),
+ backoff_s = std::max(static_cast<int64_t>(1),
std::min(backoff_s, kMaxBackoffSeconds));
return TimeDelta::FromSeconds(backoff_s);
« no previous file with comments | « sync/engine/backoff_delay_provider.h ('k') | sync/engine/commit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698