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

Side by Side Diff: chrome/browser/sync/retry_verifier.cc

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/protocol/sync_protocol_error.cc ('k') | chrome/browser/sync/sessions/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/retry_verifier.h" 5 #include "chrome/browser/sync/retry_verifier.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/sync/engine/polling_constants.h" 10 #include "sync/engine/polling_constants.h"
11 #include "chrome/browser/sync/sessions/session_state.h" 11 #include "sync/sessions/session_state.h"
12 12
13 namespace browser_sync { 13 namespace browser_sync {
14 14
15 namespace { 15 namespace {
16 // Given the current delay calculate the minimum and maximum wait times for 16 // Given the current delay calculate the minimum and maximum wait times for
17 // the next retry. 17 // the next retry.
18 DelayInfo CalculateDelay(int64 current_delay) { 18 DelayInfo CalculateDelay(int64 current_delay) {
19 int64 backoff_s = std::max(static_cast<int64>(1), current_delay * 19 int64 backoff_s = std::max(static_cast<int64>(1), current_delay *
20 browser_sync::kBackoffRandomizationFactor); 20 browser_sync::kBackoffRandomizationFactor);
21 21
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (snap.sync_start_time != last_sync_time_) { 104 if (snap.sync_start_time != last_sync_time_) {
105 base::TimeDelta delta = snap.sync_start_time - last_sync_time_; 105 base::TimeDelta delta = snap.sync_start_time - last_sync_time_;
106 success_ = IsRetryOnTime(delay_table_,retry_count_ -1, delta); 106 success_ = IsRetryOnTime(delay_table_,retry_count_ -1, delta);
107 last_sync_time_ = snap.sync_start_time; 107 last_sync_time_ = snap.sync_start_time;
108 ++retry_count_; 108 ++retry_count_;
109 done_ = (retry_count_ >= kMaxRetry); 109 done_ = (retry_count_ >= kMaxRetry);
110 return; 110 return;
111 } 111 }
112 } 112 }
113 } // namespace browser_sync 113 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/protocol/sync_protocol_error.cc ('k') | chrome/browser/sync/sessions/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698