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

Side by Side Diff: content/public/browser/background_sync_parameters.cc

Issue 1536023002: [BackgroundSync] Add max sync event duration to BackgroundSyncParameters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sync_time2
Patch Set: Rename a constant to match the others Created 4 years, 12 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
« no previous file with comments | « content/public/browser/background_sync_parameters.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « content/public/browser/background_sync_parameters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698