OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/public/browser/background_sync_parameters.h" | 5 #include "content/public/browser/background_sync_parameters.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 namespace { | 9 namespace { |
10 const int kMaxSyncAttempts = 3; | 10 const int kMaxSyncAttempts = 3; |
11 const int kInitialRetryDelayMins = 5; | |
12 const int kRetryDelayFactor = 3; | 11 const int kRetryDelayFactor = 3; |
13 const int64_t kMinSyncRecoveryTimeMs = 1000 * 60 * 6; // 6 minutes | 12 const int kInitialRetryDelaySec = 60 * 5; // 5 minutes |
| 13 const int kMaxSyncEventSec = 60 * 3; // 3 minutes |
| 14 const int64_t kMinSyncRecoveryTimeSec = 60 * 6; // 6 minutes |
14 } | 15 } |
15 | 16 |
16 BackgroundSyncParameters::BackgroundSyncParameters() | 17 BackgroundSyncParameters::BackgroundSyncParameters() |
17 : disable(false), | 18 : disable(false), |
18 max_sync_attempts(kMaxSyncAttempts), | 19 max_sync_attempts(kMaxSyncAttempts), |
19 initial_retry_delay(base::TimeDelta::FromMinutes(kInitialRetryDelayMins)), | 20 initial_retry_delay(base::TimeDelta::FromSeconds(kInitialRetryDelaySec)), |
20 retry_delay_factor(kRetryDelayFactor), | 21 retry_delay_factor(kRetryDelayFactor), |
21 min_sync_recovery_time( | 22 min_sync_recovery_time( |
22 base::TimeDelta::FromMilliseconds(kMinSyncRecoveryTimeMs)) {} | 23 base::TimeDelta::FromSeconds(kMinSyncRecoveryTimeSec)), |
| 24 max_sync_event_duration(base::TimeDelta::FromSeconds(kMaxSyncEventSec)) {} |
23 | 25 |
24 bool BackgroundSyncParameters::operator==( | 26 bool BackgroundSyncParameters::operator==( |
25 const BackgroundSyncParameters& other) const { | 27 const BackgroundSyncParameters& other) const { |
26 return disable == other.disable && | 28 return disable == other.disable && |
27 max_sync_attempts == other.max_sync_attempts && | 29 max_sync_attempts == other.max_sync_attempts && |
28 initial_retry_delay == other.initial_retry_delay && | 30 initial_retry_delay == other.initial_retry_delay && |
29 retry_delay_factor == other.retry_delay_factor && | 31 retry_delay_factor == other.retry_delay_factor && |
30 min_sync_recovery_time == other.min_sync_recovery_time; | 32 min_sync_recovery_time == other.min_sync_recovery_time && |
| 33 max_sync_event_duration == other.max_sync_event_duration; |
31 } | 34 } |
32 | 35 |
33 } // namespace content | 36 } // namespace content |
OLD | NEW |