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

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

Issue 10197004: [Sync] Convert SyncSessionSnapshot to a copy-able class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 8 years, 8 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/profile_sync_service_mock.h ('k') | chrome/browser/sync/retry_verifier.cc » ('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) 2012 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 #ifndef CHROME_BROWSER_SYNC_RETRY_VERIFIER_H_ 5 #ifndef CHROME_BROWSER_SYNC_RETRY_VERIFIER_H_
6 #define CHROME_BROWSER_SYNC_RETRY_VERIFIER_H_ 6 #define CHROME_BROWSER_SYNC_RETRY_VERIFIER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/time.h" 9 #include "base/time.h"
10 10
11 namespace browser_sync { 11 namespace browser_sync {
12
12 namespace sessions { 13 namespace sessions {
13 struct SyncSessionSnapshot; 14 class SyncSessionSnapshot;
14 } // namespace sessions 15 } // namespace sessions
15 } // namespace browser_sync
16 16
17 namespace browser_sync {
18 // The minimum and maximum wait times for a retry. The actual retry would take 17 // The minimum and maximum wait times for a retry. The actual retry would take
19 // place somewhere in this range. The algorithm that calculates the retry wait 18 // place somewhere in this range. The algorithm that calculates the retry wait
20 // time uses rand functions. 19 // time uses rand functions.
21 struct DelayInfo { 20 struct DelayInfo {
22 int64 min_delay; 21 int64 min_delay;
23 int64 max_delay; 22 int64 max_delay;
24 }; 23 };
25 24
26 // Class to verify retries take place using the exponential backoff algorithm. 25 // Class to verify retries take place using the exponential backoff algorithm.
27 class RetryVerifier { 26 class RetryVerifier {
(...skipping 12 matching lines...) Expand all
40 bool Succeeded() const { return done() && success_; } 39 bool Succeeded() const { return done() && success_; }
41 40
42 private: 41 private:
43 int retry_count_; 42 int retry_count_;
44 base::Time last_sync_time_; 43 base::Time last_sync_time_;
45 DelayInfo delay_table_[kMaxRetry]; 44 DelayInfo delay_table_[kMaxRetry];
46 bool success_; 45 bool success_;
47 bool done_; 46 bool done_;
48 DISALLOW_COPY_AND_ASSIGN(RetryVerifier); 47 DISALLOW_COPY_AND_ASSIGN(RetryVerifier);
49 }; 48 };
49
50 } // namespace browser_sync 50 } // namespace browser_sync
51
51 #endif // CHROME_BROWSER_SYNC_RETRY_VERIFIER_H_ 52 #endif // CHROME_BROWSER_SYNC_RETRY_VERIFIER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_mock.h ('k') | chrome/browser/sync/retry_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698