[webkit-reviews] review denied: [Bug 179441] [Service Workers] Implement better support for "Clear Registration" algorithm : [Attachment 326632] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 10 15:16:22 PST 2017


Brady Eidson <beidson at apple.com> has denied Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 179441: [Service Workers] Implement better support for "Clear Registration"
algorithm
https://bugs.webkit.org/show_bug.cgi?id=179441

Attachment 326632: Patch

https://bugs.webkit.org/attachment.cgi?id=326632&action=review




--- Comment #13 from Brady Eidson <beidson at apple.com> ---
Comment on attachment 326632
  --> https://bugs.webkit.org/attachment.cgi?id=326632
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=326632&action=review

> Source/WebCore/workers/service/server/SWServerJobQueue.cpp:364
> +    if (auto* installingWorker = registration.installingWorker()) {
> +	   // Terminate registration's installing worker.
> +	   installingWorker->terminate();
> +	   // Run the Update Worker State algorithm passing registration's
installing worker and redundant as the arguments.
> +	   registration.updateWorkerState(*installingWorker,
ServiceWorkerState::Redundant);
> +	   // Run the Update Registration State algorithm passing registration,
"installing" and null as the arguments.
> +	  
registration.updateRegistrationState(ServiceWorkerRegistrationState::Installing
, nullptr);
> +    }
> +    // If registration's waiting worker is not null, then:
> +    if (auto* waitingWorker = registration.waitingWorker()) {
> +	   // Terminate registration's waiting worker.
> +	   waitingWorker->terminate();
> +	   // Run the Update Worker State algorithm passing registration's
waiting worker and redundant as the arguments.
> +	   registration.updateWorkerState(*waitingWorker,
ServiceWorkerState::Redundant);
> +	   // Run the Update Registration State algorithm passing registration,
"waiting" and null as the arguments.
> +	  
registration.updateRegistrationState(ServiceWorkerRegistrationState::Waiting,
nullptr);
> +    }
> +    // If registration's active worker is not null, then:
> +    if (auto* activeWorker = registration.activeWorker()) {
> +	   // Terminate registration's active worker.
> +	   activeWorker->terminate();
> +	   // Run the Update Worker State algorithm passing registration's
active worker and redundant as the arguments.
> +	   registration.updateWorkerState(*activeWorker,
ServiceWorkerState::Redundant);
> +	   // Run the Update Registration State algorithm passing registration,
"active" and null as the arguments.
> +	  
registration.updateRegistrationState(ServiceWorkerRegistrationState::Active,
nullptr);
> +    }

All this code clearly needs to be broken out into a utility function


More information about the webkit-reviews mailing list