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

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

Issue 1220223003: [Background Sync] Add sync registration details to onsync event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add MODULES_EXPORT declaration to SyncRegistration 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: Source/modules/background_sync/SyncRegistration.cpp
diff --git a/Source/modules/background_sync/SyncRegistration.cpp b/Source/modules/background_sync/SyncRegistration.cpp
index fa71ba8060507250ba9527160730d63a08e5797d..54c814dce237464a4cc7e948bc62404e07f44173 100644
--- a/Source/modules/background_sync/SyncRegistration.cpp
+++ b/Source/modules/background_sync/SyncRegistration.cpp
@@ -20,12 +20,17 @@
namespace blink {
+SyncRegistration* SyncRegistration::create(const WebSyncRegistration& syncRegistration, ServiceWorkerRegistration* serviceWorkerRegistration)
+{
+ SyncRegistrationOptions options = SyncRegistrationOptions();
+ options.setTag(syncRegistration.tag);
+ return new SyncRegistration(syncRegistration.id, options, serviceWorkerRegistration);
+}
+
SyncRegistration* SyncRegistration::take(ScriptPromiseResolver*, WebSyncRegistration* syncRegistration, ServiceWorkerRegistration* serviceWorkerRegistration)
{
OwnPtr<WebSyncRegistration> registration = adoptPtr(syncRegistration);
- SyncRegistrationOptions options = SyncRegistrationOptions();
- options.setTag(syncRegistration->tag);
- return new SyncRegistration(syncRegistration->id, options, serviceWorkerRegistration);
+ return create(*syncRegistration, serviceWorkerRegistration);
}
void SyncRegistration::dispose(WebSyncRegistration* syncRegistration)

Powered by Google App Engine
This is Rietveld 408576698