| Index: Source/modules/background_sync/PeriodicSyncRegistration.cpp
|
| diff --git a/Source/modules/background_sync/PeriodicSyncRegistration.cpp b/Source/modules/background_sync/PeriodicSyncRegistration.cpp
|
| index 092da01b94407745901977bdc5ff78595073c1e4..b67ada9b89d5e5acda100f646667a1ec357792cb 100644
|
| --- a/Source/modules/background_sync/PeriodicSyncRegistration.cpp
|
| +++ b/Source/modules/background_sync/PeriodicSyncRegistration.cpp
|
| @@ -20,12 +20,11 @@
|
|
|
| namespace blink {
|
|
|
| -PeriodicSyncRegistration* PeriodicSyncRegistration::take(ScriptPromiseResolver*, WebSyncRegistration* syncRegistration, ServiceWorkerRegistration* serviceWorkerRegistration)
|
| +PeriodicSyncRegistration* PeriodicSyncRegistration::take(ScriptPromiseResolver*, PassOwnPtr<WebSyncRegistration> registration, ServiceWorkerRegistration* serviceWorkerRegistration)
|
| {
|
| - OwnPtr<WebSyncRegistration> registration = adoptPtr(syncRegistration);
|
| PeriodicSyncRegistrationOptions options = PeriodicSyncRegistrationOptions();
|
| - options.setMinPeriod(syncRegistration->minPeriodMs);
|
| - switch (syncRegistration->networkState) {
|
| + options.setMinPeriod(registration->minPeriodMs);
|
| + switch (registration->networkState) {
|
| case WebSyncRegistration::NetworkState::NetworkStateAny:
|
| options.setNetworkState("any");
|
| break;
|
| @@ -36,7 +35,7 @@ PeriodicSyncRegistration* PeriodicSyncRegistration::take(ScriptPromiseResolver*,
|
| options.setNetworkState("online");
|
| break;
|
| }
|
| - switch (syncRegistration->powerState) {
|
| + switch (registration->powerState) {
|
| case WebSyncRegistration::PowerState::PowerStateAuto:
|
| options.setPowerState("auto");
|
| break;
|
| @@ -44,14 +43,8 @@ PeriodicSyncRegistration* PeriodicSyncRegistration::take(ScriptPromiseResolver*,
|
| options.setPowerState("avoid-draining");
|
| break;
|
| }
|
| - options.setTag(syncRegistration->tag);
|
| - return new PeriodicSyncRegistration(syncRegistration->id, options, serviceWorkerRegistration);
|
| -}
|
| -
|
| -void PeriodicSyncRegistration::dispose(WebSyncRegistration* syncRegistration)
|
| -{
|
| - if (syncRegistration)
|
| - delete syncRegistration;
|
| + options.setTag(registration->tag);
|
| + return new PeriodicSyncRegistration(registration->id, options, serviceWorkerRegistration);
|
| }
|
|
|
| PeriodicSyncRegistration::PeriodicSyncRegistration(int64_t id, const PeriodicSyncRegistrationOptions& options, ServiceWorkerRegistration* serviceWorkerRegistration)
|
|
|