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

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: Fix: Missing words in comment 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
« no previous file with comments | « Source/modules/background_sync/SyncRegistration.h ('k') | Source/web/ServiceWorkerGlobalScopeProxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/modules/background_sync/SyncRegistration.h ('k') | Source/web/ServiceWorkerGlobalScopeProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698