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

Unified Diff: content/browser/background_sync/background_sync_manager.cc

Issue 1230213004: [Background Sync] Sent sync registration details to worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bgsync-event-mek
Patch Set: Validate safety of static_casts Created 5 years, 5 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 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 a9226316ea34980666454c478c989db2a1430698..daa5c2043d69ade1b5132b9f5c8b4022fba3d88b 100644
--- a/content/browser/background_sync/background_sync_manager.cc
+++ b/content/browser/background_sync/background_sync_manager.cc
@@ -534,11 +534,13 @@ void BackgroundSyncManager::GetDataFromBackend(
}
void BackgroundSyncManager::FireOneShotSync(
+ BackgroundSyncRegistration* registration,
const scoped_refptr<ServiceWorkerVersion>& active_version,
const ServiceWorkerVersion::StatusCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- active_version->DispatchSyncEvent(callback);
+ active_version->DispatchSyncEvent(
+ mojo::ConvertTo<SyncRegistrationPtr>(*registration), callback);
}
void BackgroundSyncManager::UnregisterImpl(
@@ -775,8 +777,11 @@ void BackgroundSyncManager::FireReadyEventsDidFindRegistration(
return;
}
+ BackgroundSyncRegistration* registration =
+ LookupRegistration(service_worker_registration->id(), registration_key);
+
FireOneShotSync(
- service_worker_registration->active_version(),
+ registration, service_worker_registration->active_version(),
base::Bind(&BackgroundSyncManager::EventComplete,
weak_ptr_factory_.GetWeakPtr(), service_worker_registration,
service_worker_registration->id(), registration_key,

Powered by Google App Engine
This is Rietveld 408576698