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

Unified Diff: content/browser/background_sync/background_sync_manager.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: content/browser/background_sync/background_sync_manager.cc
diff --git a/content/browser/background_sync/background_sync_manager.cc b/content/browser/background_sync/background_sync_manager.cc
index 327802d8567fc938f231fb786a78c4b5b504fb05..2896beaade4f62f14eb4c221d25daa42a57f2e1f 100644
--- a/content/browser/background_sync/background_sync_manager.cc
+++ b/content/browser/background_sync/background_sync_manager.cc
@@ -50,9 +50,6 @@ namespace {
// The key used to index the background sync data in ServiceWorkerStorage.
const char kBackgroundSyncUserDataKey[] = "BackgroundSyncUserData";
-// The amount of time that a sync event can fire for, in seconds.
-const int kSyncEventSec = 3 * 60; // 3 minutes
-
void PostErrorResponse(
BackgroundSyncStatus status,
const BackgroundSyncManager::StatusAndRegistrationCallback& callback) {
@@ -777,9 +774,8 @@ void BackgroundSyncManager::FireOneShotSync(
// with the registration so don't give it a BackgroundSyncRegistrationHandle.
// Once the render process gets the handle_id it can create its own handle
// (with a new unique handle id).
- active_version->DispatchSyncEvent(handle_id, last_chance,
- base::TimeDelta::FromSeconds(kSyncEventSec),
- callback);
+ active_version->DispatchSyncEvent(
+ handle_id, last_chance, parameters_->max_sync_event_duration, callback);
}
void BackgroundSyncManager::ScheduleDelayedTask(const base::Closure& callback,

Powered by Google App Engine
This is Rietveld 408576698