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

Unified Diff: third_party/WebKit/Source/modules/background_sync/SyncManager.cpp

Issue 1437883002: [Background Sync] Align exposed API with spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src@remove-periodic
Patch Set: Rebase Created 5 years, 1 month 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: third_party/WebKit/Source/modules/background_sync/SyncManager.cpp
diff --git a/third_party/WebKit/Source/modules/background_sync/SyncManager.cpp b/third_party/WebKit/Source/modules/background_sync/SyncManager.cpp
index dae56c1ee0bac3ef2752359b1c8f7cef27142c26..459367201ca31b97e0398bf22db0b6e2233f7934 100644
--- a/third_party/WebKit/Source/modules/background_sync/SyncManager.cpp
+++ b/third_party/WebKit/Source/modules/background_sync/SyncManager.cpp
@@ -40,7 +40,7 @@ SyncManager::SyncManager(ServiceWorkerRegistration* registration)
ASSERT(registration);
}
-ScriptPromise SyncManager::registerFunction(ScriptState* scriptState, ExecutionContext* context, const SyncRegistrationOptions& options)
+ScriptPromise SyncManager::registerFunction(ScriptState* scriptState, ExecutionContext* context, const String& tag)
{
// TODO(jkarlin): Wait for the registration to become active instead of rejecting. See crbug.com/542437.
if (!m_registration->active())
@@ -52,7 +52,7 @@ ScriptPromise SyncManager::registerFunction(ScriptState* scriptState, ExecutionC
WebSyncRegistration* webSyncRegistration = new WebSyncRegistration(
WebSyncRegistration::UNREGISTERED_SYNC_ID /* id */,
WebSyncRegistration::PeriodicityOneShot,
- options.tag(),
+ tag,
0 /* minPeriod */,
WebSyncRegistration::NetworkStateOnline /* networkState */,
WebSyncRegistration::PowerStateAuto /* powerState */
@@ -62,17 +62,7 @@ ScriptPromise SyncManager::registerFunction(ScriptState* scriptState, ExecutionC
return promise;
}
-ScriptPromise SyncManager::getRegistration(ScriptState* scriptState, const String& syncRegistrationId)
-{
- ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
- ScriptPromise promise = resolver->promise();
-
- backgroundSyncProvider()->getRegistration(WebSyncRegistration::PeriodicityOneShot, syncRegistrationId, m_registration->webRegistration(), new SyncRegistrationCallbacks(resolver, m_registration));
-
- return promise;
-}
-
-ScriptPromise SyncManager::getRegistrations(ScriptState* scriptState)
+ScriptPromise SyncManager::getTags(ScriptState* scriptState)
{
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
@@ -82,16 +72,6 @@ ScriptPromise SyncManager::getRegistrations(ScriptState* scriptState)
return promise;
}
-ScriptPromise SyncManager::permissionState(ScriptState* scriptState)
-{
- ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
- ScriptPromise promise = resolver->promise();
-
- backgroundSyncProvider()->getPermissionStatus(WebSyncRegistration::PeriodicityOneShot, m_registration->webRegistration(), new SyncGetPermissionStatusCallbacks(resolver, m_registration));
-
- return promise;
-}
-
DEFINE_TRACE(SyncManager)
{
visitor->trace(m_registration);

Powered by Google App Engine
This is Rietveld 408576698