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

Unified Diff: chrome/browser/background_sync/background_sync_controller_impl.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 5 years 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
Index: chrome/browser/background_sync/background_sync_controller_impl.cc
diff --git a/chrome/browser/background_sync/background_sync_controller_impl.cc b/chrome/browser/background_sync/background_sync_controller_impl.cc
index 0a4740ff2280a17bf879d1bcbbc9b08bc3bad16a..dce6b2a5107a090ac0e5aaec478f343a7b845607 100644
--- a/chrome/browser/background_sync/background_sync_controller_impl.cc
+++ b/chrome/browser/background_sync/background_sync_controller_impl.cc
@@ -23,11 +23,13 @@ const char BackgroundSyncControllerImpl::kDisabledParameterName[] = "disabled";
const char BackgroundSyncControllerImpl::kMaxAttemptsParameterName[] =
"max_sync_attempts";
const char BackgroundSyncControllerImpl::kInitialRetryParameterName[] =
- "initial_retry_delay_mins";
+ "initial_retry_delay_sec";
const char BackgroundSyncControllerImpl::kRetryDelayFactorParameterName[] =
"retry_delay_factor";
const char BackgroundSyncControllerImpl::kMinSyncRecoveryTimeName[] =
- "min_recovery_time_ms";
+ "min_recovery_time_sec";
+const char BackgroundSyncControllerImpl::kMaxSyncEventDurationName[] =
+ "max_sync_event_duration_sec";
BackgroundSyncControllerImpl::BackgroundSyncControllerImpl(Profile* profile)
: profile_(profile) {}
@@ -56,11 +58,11 @@ void BackgroundSyncControllerImpl::GetParameterOverrides(
}
if (ContainsKey(field_params, kInitialRetryParameterName)) {
- int initial_retry_delay_min;
+ int initial_retry_delay_sec;
if (base::StringToInt(field_params[kInitialRetryParameterName],
- &initial_retry_delay_min)) {
+ &initial_retry_delay_sec)) {
parameters->initial_retry_delay =
- base::TimeDelta::FromMinutes(initial_retry_delay_min);
+ base::TimeDelta::FromSeconds(initial_retry_delay_sec);
}
}
@@ -73,11 +75,20 @@ void BackgroundSyncControllerImpl::GetParameterOverrides(
}
if (ContainsKey(field_params, kMinSyncRecoveryTimeName)) {
- int64_t min_sync_recovery_time_ms;
- if (base::StringToInt64(field_params[kMinSyncRecoveryTimeName],
- &min_sync_recovery_time_ms)) {
+ int min_sync_recovery_time_sec;
+ if (base::StringToInt(field_params[kMinSyncRecoveryTimeName],
+ &min_sync_recovery_time_sec)) {
parameters->min_sync_recovery_time =
- base::TimeDelta::FromMilliseconds(min_sync_recovery_time_ms);
+ base::TimeDelta::FromSeconds(min_sync_recovery_time_sec);
+ }
+ }
+
+ if (ContainsKey(field_params, kMaxSyncEventDurationName)) {
+ int max_sync_event_duration_sec;
+ if (base::StringToInt(field_params[kMaxSyncEventDurationName],
+ &max_sync_event_duration_sec)) {
+ parameters->max_sync_event_duration =
+ base::TimeDelta::FromSeconds(max_sync_event_duration_sec);
}
}

Powered by Google App Engine
This is Rietveld 408576698