Changeset 227967 in webkit


Ignore:
Timestamp:
Feb 1, 2018 9:10:18 AM (6 years ago)
Author:
Chris Dumez
Message:

We no longer need to queue service worker jobs until the connection to the service worker process has been established
https://bugs.webkit.org/show_bug.cgi?id=182375

Reviewed by Youenn Fablet.

We no longer need to queue service worker jobs until the connection to the service worker process
has been established. We initially did this to work around the fact that registrations restored
from disk would not have an active worker until the service worker process had been established.
However, this issue has been fixed in r227696.

This is basically a revert of r227220, which is no longer needed after r227696.

No new tests, initial fix was covered by an API test that still passes.

  • workers/service/server/SWServer.cpp:

(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
(WebCore::SWServer::scheduleJob):
(WebCore::SWServer::serverToContextConnectionCreated):

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r227966 r227967  
     12018-02-01  Chris Dumez  <cdumez@apple.com>
     2
     3        We no longer need to queue service worker jobs until the connection to the service worker process has been established
     4        https://bugs.webkit.org/show_bug.cgi?id=182375
     5
     6        Reviewed by Youenn Fablet.
     7
     8        We no longer need to queue service worker jobs until the connection to the service worker process
     9        has been established. We initially did this to work around the fact that registrations restored
     10        from disk would not have an active worker until the service worker process had been established.
     11        However, this issue has been fixed in r227696.
     12
     13        This is basically a revert of r227220, which is no longer needed after r227696.
     14
     15        No new tests, initial fix was covered by an API test that still passes.
     16
     17        * workers/service/server/SWServer.cpp:
     18        (WebCore::SWServer::clearAll):
     19        (WebCore::SWServer::clear):
     20        (WebCore::SWServer::scheduleJob):
     21        (WebCore::SWServer::serverToContextConnectionCreated):
     22        * workers/service/server/SWServer.h:
     23
    1242018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
    225
  • trunk/Source/WebCore/workers/service/server/SWServer.cpp

    r227932 r227967  
    190190    ASSERT(m_registrationsByID.isEmpty());
    191191    m_pendingContextDatas.clear();
    192     m_pendingJobs.clear();
    193192    m_originStore->clearAll();
    194193    m_registrationStore.clearAll(WTFMove(completionHandler));
     
    211210    });
    212211
    213     m_pendingJobs.removeAllMatching([&](auto& job) {
    214         return job.registrationKey().relatesToOrigin(origin);
    215     });
    216 
    217212    // Calling SWServerRegistration::clear() takes care of updating m_registrations, m_originStore and m_registrationStore.
    218213    for (auto* registration : registrationsToRemove)
     
    269264{
    270265    ASSERT(m_connections.contains(jobData.connectionIdentifier()));
    271 
    272     if (!SWServerToContextConnection::globalServerToContextConnection()) {
    273         m_pendingJobs.append(WTFMove(jobData));
    274         return;
    275     }
    276266
    277267    // FIXME: Per the spec, check if this job is equivalent to the last job on the queue.
     
    495485            callback(success, *connection);
    496486    }
    497 
    498     auto pendingJobs = WTFMove(m_pendingJobs);
    499     for (auto& jobData : pendingJobs)
    500         scheduleJob(WTFMove(jobData));
    501487}
    502488
  • trunk/Source/WebCore/workers/service/server/SWServer.h

    r227745 r227967  
    224224    RegistrationStore m_registrationStore;
    225225    Vector<ServiceWorkerContextData> m_pendingContextDatas;
    226     Vector<ServiceWorkerJobData> m_pendingJobs;
    227226    HashMap<ServiceWorkerIdentifier, Vector<RunServiceWorkerCallback>> m_serviceWorkerRunRequests;
    228227    PAL::SessionID m_sessionID;
Note: See TracChangeset for help on using the changeset viewer.