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

Unified Diff: components/sync/engine_impl/backoff_delay_provider.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 months 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
Index: components/sync/engine_impl/backoff_delay_provider.cc
diff --git a/sync/engine/backoff_delay_provider.cc b/components/sync/engine_impl/backoff_delay_provider.cc
similarity index 92%
rename from sync/engine/backoff_delay_provider.cc
rename to components/sync/engine_impl/backoff_delay_provider.cc
index 864401cc9c9cb390d24cfbed446f97cacf5ed0e8..fee7c99fb6431e3ec7f99e1d77b0aab07300e86a 100644
--- a/sync/engine/backoff_delay_provider.cc
+++ b/components/sync/engine_impl/backoff_delay_provider.cc
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/engine/backoff_delay_provider.h"
+#include "components/sync/engine_impl/backoff_delay_provider.h"
#include <stdint.h>
#include <algorithm>
#include "base/rand_util.h"
-#include "sync/internal_api/public/engine/polling_constants.h"
-#include "sync/internal_api/public/sessions/model_neutral_state.h"
-#include "sync/internal_api/public/util/syncer_error.h"
+#include "components/sync/base/syncer_error.h"
+#include "components/sync/engine/polling_constants.h"
+#include "components/sync/sessions/model_neutral_state.h"
using base::TimeDelta;
@@ -35,8 +35,7 @@ BackoffDelayProvider::BackoffDelayProvider(
const base::TimeDelta& default_initial_backoff,
const base::TimeDelta& short_initial_backoff)
: default_initial_backoff_(default_initial_backoff),
- short_initial_backoff_(short_initial_backoff) {
-}
+ short_initial_backoff_(short_initial_backoff) {}
BackoffDelayProvider::~BackoffDelayProvider() {}
@@ -53,7 +52,8 @@ TimeDelta BackoffDelayProvider::GetDelay(const base::TimeDelta& last_delay) {
int rand_sign = base::RandInt(0, 1) * 2 - 1;
// Truncation is adequate for rounding here.
- backoff_s = backoff_s +
+ backoff_s =
+ backoff_s +
(rand_sign * (last_delay.InSeconds() / kBackoffRandomizationFactor));
// Cap the backoff interval.
« no previous file with comments | « components/sync/engine_impl/backoff_delay_provider.h ('k') | components/sync/engine_impl/backoff_delay_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698