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

Unified Diff: chrome/browser/sync/engine/all_status.cc

Issue 3078022: Unplumb AllStatus from SyncerThread. (Closed)
Patch Set: parens Created 10 years, 4 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
« no previous file with comments | « chrome/browser/sync/engine/all_status.h ('k') | chrome/browser/sync/engine/all_status_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/all_status.cc
diff --git a/chrome/browser/sync/engine/all_status.cc b/chrome/browser/sync/engine/all_status.cc
index 6c489052eaee8e139db83aab8257ba760ba35a18..178fe7f3ba1164e77e64470869a42e4aad76b7b9 100644
--- a/chrome/browser/sync/engine/all_status.cc
+++ b/chrome/browser/sync/engine/all_status.cc
@@ -8,7 +8,6 @@
#include "base/logging.h"
#include "base/port.h"
-#include "base/rand_util.h"
#include "chrome/browser/sync/engine/auth_watcher.h"
#include "chrome/browser/sync/engine/net/server_connection_manager.h"
#include "chrome/browser/sync/engine/syncer.h"
@@ -23,11 +22,6 @@ namespace browser_sync {
static const time_t kMinSyncObserveInterval = 10; // seconds
-// Backoff interval randomization factor.
-static const int kBackoffRandomizationFactor = 2;
-
-const int AllStatus::kMaxBackoffSeconds = 60 * 60 * 4; // 4 hours.
-
const char* AllStatus::GetSyncStatusString(SyncStatus icon) {
const char* strings[] = {"OFFLINE", "OFFLINE_UNSYNCED", "SYNCING", "READY",
"CONFLICT", "OFFLINE_UNUSABLE"};
@@ -236,31 +230,6 @@ AllStatus::Status AllStatus::status() const {
return status_;
}
-int AllStatus::GetRecommendedDelaySeconds(int base_delay_seconds) {
- if (base_delay_seconds >= kMaxBackoffSeconds)
- return kMaxBackoffSeconds;
-
- // This calculates approx. base_delay_seconds * 2 +/- base_delay_seconds / 2
- int backoff_s = (0 == base_delay_seconds) ? 1 :
- base_delay_seconds * kBackoffRandomizationFactor;
-
- // Flip a coin to randomize backoff interval by +/- 50%.
- int rand_sign = base::RandInt(0, 1) * 2 - 1;
-
- // Truncation is adequate for rounding here.
- backoff_s = backoff_s +
- (rand_sign * (base_delay_seconds / kBackoffRandomizationFactor));
-
- // Cap the backoff interval.
- backoff_s = std::min(backoff_s, kMaxBackoffSeconds);
-
- return backoff_s;
-}
-
-int AllStatus::GetRecommendedDelay(int base_delay_ms) const {
- return GetRecommendedDelaySeconds(base_delay_ms / 1000) * 1000;
-}
-
void AllStatus::SetNotificationsEnabled(bool notifications_enabled) {
ScopedStatusLockWithNotify lock(this);
status_.notifications_enabled = notifications_enabled;
« no previous file with comments | « chrome/browser/sync/engine/all_status.h ('k') | chrome/browser/sync/engine/all_status_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698