Changeset 227932 in webkit


Ignore:
Timestamp:
Jan 31, 2018 2:40:10 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Change SWServer::claim to set the iterator value as soon as possible
https://bugs.webkit.org/show_bug.cgi?id=182337

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-31
Reviewed by Chris Dumez.

No change of behavior, this is a "let's go safe way" fix.

  • workers/service/server/SWServer.cpp:

(WebCore::SWServer::claim):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r227928 r227932  
     12018-01-31  Youenn Fablet  <youenn@apple.com>
     2
     3        Change SWServer::claim to set the iterator value as soon as possible
     4        https://bugs.webkit.org/show_bug.cgi?id=182337
     5
     6        Reviewed by Chris Dumez.
     7
     8        No change of behavior, this is a "let's go safe way" fix.
     9
     10        * workers/service/server/SWServer.cpp:
     11        (WebCore::SWServer::claim):
     12
    1132018-01-31  Zalan Bujtas  <zalan@apple.com>
    214
  • trunk/Source/WebCore/workers/service/server/SWServer.cpp

    r227796 r227932  
    421421        auto result = m_clientToControllingWorker.add(clientData.identifier, worker.identifier());
    422422        if (!result.isNewEntry) {
    423             if (result.iterator->value == worker.identifier())
     423            auto previousIdentifier = result.iterator->value;
     424            if (previousIdentifier == worker.identifier())
    424425                return;
    425             if (auto* controllingRegistration = registrationFromServiceWorkerIdentifier(result.iterator->value))
     426            result.iterator->value = worker.identifier();
     427            if (auto* controllingRegistration = registrationFromServiceWorkerIdentifier(previousIdentifier))
    426428                controllingRegistration->removeClientUsingRegistration(clientData.identifier);
    427             result.iterator->value = worker.identifier();
    428429        }
    429430        registration->controlClient(clientData.identifier);
Note: See TracChangeset for help on using the changeset viewer.