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

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

Issue 2575403002: [BackgroundSync]: Resolve the register promise before firing sync events (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 97ba87a7e522916fdb14951138adeb80a658b34d..cad67586a526872c259fea3b4ab2e8f7c64175e4 100644
--- a/content/browser/background_sync/background_sync_manager.cc
+++ b/content/browser/background_sync/background_sync_manager.cc
@@ -687,13 +687,13 @@ void BackgroundSyncManager::RegisterDidStore(
registration_could_fire,
BackgroundSyncMetrics::REGISTRATION_IS_NOT_DUPLICATE);
- FireReadyEvents();
-
- base::ThreadTaskRunnerHandle::Get()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTaskAndReply(
FROM_HERE,
base::Bind(callback, BACKGROUND_SYNC_STATUS_OK,
base::Passed(base::MakeUnique<BackgroundSyncRegistration>(
- new_registration))));
+ new_registration))),
+ base::Bind(&BackgroundSyncManager::FireReadyEvents,
+ weak_ptr_factory_.GetWeakPtr()));
}
void BackgroundSyncManager::RemoveActiveRegistration(int64_t sw_registration_id,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698