Changeset 225483 in webkit


Ignore:
Timestamp:
Dec 4, 2017 10:55:07 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Add support https://w3c.github.io/ServiceWorker/#on-client-unload-algorithm
https://bugs.webkit.org/show_bug.cgi?id=180359

Patch by Youenn Fablet <youenn@apple.com> on 2017-12-04
Reviewed by Chris Dumez.

This algorithm is needed for implementation of claim.
As per specification, it is run for every client unload, hence why this is put in removeClientUsingRegistration.

  • workers/service/server/SWServerRegistration.cpp:

(WebCore::SWServerRegistration::removeClientUsingRegistration):
(WebCore::SWServerRegistration::handleClientUnload):

  • workers/service/server/SWServerRegistration.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r225482 r225483  
     12017-12-04  Youenn Fablet  <youenn@apple.com>
     2
     3        Add support https://w3c.github.io/ServiceWorker/#on-client-unload-algorithm
     4        https://bugs.webkit.org/show_bug.cgi?id=180359
     5
     6        Reviewed by Chris Dumez.
     7
     8        This algorithm is needed for implementation of claim.
     9        As per specification, it is run for every client unload, hence why this is put in removeClientUsingRegistration.
     10
     11        * workers/service/server/SWServerRegistration.cpp:
     12        (WebCore::SWServerRegistration::removeClientUsingRegistration):
     13        (WebCore::SWServerRegistration::handleClientUnload):
     14        * workers/service/server/SWServerRegistration.h:
     15
    1162017-12-04  Antti Koivisto  <antti@apple.com>
    217
  • trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp

    r225460 r225483  
    162162    if (iterator->value.isEmpty())
    163163        m_clientsUsingRegistration.remove(iterator);
     164
     165    handleClientUnload();
    164166}
    165167
     
    282284}
    283285
     286// https://w3c.github.io/ServiceWorker/#on-client-unload-algorithm
     287void SWServerRegistration::handleClientUnload()
     288{
     289    if (hasClientsUsingRegistration())
     290        return;
     291    if (isUninstalling() && tryClear())
     292        return;
     293    tryActivate();
     294}
     295
    284296} // namespace WebCore
    285297
  • trunk/Source/WebCore/workers/service/server/SWServerRegistration.h

    r225457 r225483  
    9191
    9292    void activate();
     93    void handleClientUnload();
    9394
    9495    ServiceWorkerRegistrationIdentifier m_identifier;
Note: See TracChangeset for help on using the changeset viewer.