[webkit-reviews] review granted: [Bug 179480] matchRegistration does not need to go to StorageProcess if no service worker is registered : [Attachment 326806] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 13 15:15:59 PST 2017


Chris Dumez <cdumez at apple.com> has granted youenn fablet <youennf at gmail.com>'s
request for review:
Bug 179480: matchRegistration does not need to go to StorageProcess if no
service worker is registered
https://bugs.webkit.org/show_bug.cgi?id=179480

Attachment 326806: Patch

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




--- Comment #21 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 326806
  --> https://bugs.webkit.org/attachment.cgi?id=326806
Patch

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

r=me with changes.

> Source/WebCore/workers/service/server/SWServer.cpp:88
> +    auto result = m_registrations.set(key, WTFMove(registration));

Should be an add(), not a set(). We should never overwrite.

> Source/WebCore/workers/service/server/SWServer.cpp:115
> +    m_registrations.removeIf([&] (auto& entry) {

We should not make this change unless we also clear the right jobQueues.
otherwise, we will end up with jobQueues that are out of sync with the server
(expect a registration to be there but isn't).

Let's clear the jobQueues:
m_jobQueues.removeIf([&] (auto& entry) {
    return entry.key.topOrigin() == originData;
});


More information about the webkit-reviews mailing list