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

Unified Diff: Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp

Issue 1096503002: [Background Sync] Converting Blink code to the MVP API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Unregister method requires the sync registration tag Created 5 years, 8 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: Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp
diff --git a/Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp b/Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp
index e169b8a640d7983508f69b627753f7cce9bdcf27..67516eee0e58732b086e04b55127a06cf6797965 100644
--- a/Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp
+++ b/Source/modules/background_sync/ServiceWorkerRegistrationSync.cpp
@@ -5,6 +5,7 @@
#include "config.h"
#include "modules/background_sync/ServiceWorkerRegistrationSync.h"
+#include "modules/background_sync/PeriodicSyncManager.h"
#include "modules/background_sync/SyncManager.h"
#include "modules/serviceworkers/ServiceWorkerRegistration.h"
@@ -34,22 +35,35 @@ ServiceWorkerRegistrationSync& ServiceWorkerRegistrationSync::from(ServiceWorker
return *supplement;
}
-SyncManager* ServiceWorkerRegistrationSync::syncManager(ServiceWorkerRegistration& registration)
+SyncManager* ServiceWorkerRegistrationSync::sync(ServiceWorkerRegistration& registration)
{
- return ServiceWorkerRegistrationSync::from(registration).syncManager();
+ return ServiceWorkerRegistrationSync::from(registration).sync();
}
-SyncManager* ServiceWorkerRegistrationSync::syncManager()
+SyncManager* ServiceWorkerRegistrationSync::sync()
{
if (!m_syncManager)
m_syncManager = SyncManager::create(m_registration);
return m_syncManager.get();
}
+PeriodicSyncManager* ServiceWorkerRegistrationSync::periodicSync(ServiceWorkerRegistration& registration)
+{
+ return ServiceWorkerRegistrationSync::from(registration).periodicSync();
+}
+
+PeriodicSyncManager* ServiceWorkerRegistrationSync::periodicSync()
+{
+ if (!m_periodicSyncManager)
+ m_periodicSyncManager = PeriodicSyncManager::create(m_registration);
+ return m_periodicSyncManager.get();
+}
+
DEFINE_TRACE(ServiceWorkerRegistrationSync)
{
visitor->trace(m_registration);
visitor->trace(m_syncManager);
+ visitor->trace(m_periodicSyncManager);
HeapSupplement<ServiceWorkerRegistration>::trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698