⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276499 in webkit


Ignore:
Timestamp:
Apr 23, 2021, 8:40:24 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Improve HashTableDeletedValue of ServiceWorkerRegistrationKey
https://bugs.webkit.org/show_bug.cgi?id=224975

Patch by Michael Catanzaro <Michael Catanzaro> on 2021-04-23
Reviewed by Chris Dumez.

We construct only the SecurityOriginData, no need to construct a full
ServiceWorkerRegistrationKey or URL. No behavior changes.

  • workers/service/ServiceWorkerRegistrationKey.h:

(WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue):
(WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::isDeletedValue):
(WebCore::ServiceWorkerRegistrationKey::isHashTableDeletedValue const): Deleted.
(WebCore::ServiceWorkerRegistrationKey::ServiceWorkerRegistrationKey): Deleted.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r276497 r276499  
     12021-04-23  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        Improve HashTableDeletedValue of ServiceWorkerRegistrationKey
     4        https://bugs.webkit.org/show_bug.cgi?id=224975
     5
     6        Reviewed by Chris Dumez.
     7
     8        We construct only the SecurityOriginData, no need to construct a full
     9        ServiceWorkerRegistrationKey or URL. No behavior changes.
     10
     11        * workers/service/ServiceWorkerRegistrationKey.h:
     12        (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue):
     13        (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::isDeletedValue):
     14        (WebCore::ServiceWorkerRegistrationKey::isHashTableDeletedValue const): Deleted.
     15        (WebCore::ServiceWorkerRegistrationKey::ServiceWorkerRegistrationKey): Deleted.
     16
    1172021-04-23  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h

    r276361 r276499  
    3636public:
    3737    ServiceWorkerRegistrationKey() = default;
    38     explicit ServiceWorkerRegistrationKey(WTF::HashTableDeletedValueType);
    3938    WEBCORE_EXPORT ServiceWorkerRegistrationKey(SecurityOriginData&& topOrigin, URL&& scope);
    4039
     
    6766#endif
    6867
    69     bool isHashTableDeletedValue() const { return m_topOrigin.isHashTableDeletedValue(); }
     68private:
     69    friend struct HashTraits<ServiceWorkerRegistrationKey>;
    7070
    71 private:
    7271    SecurityOriginData m_topOrigin;
    7372    URL m_scope;
    7473};
    75 
    76 inline ServiceWorkerRegistrationKey::ServiceWorkerRegistrationKey(WTF::HashTableDeletedValueType)
    77     : m_topOrigin(WTF::HashTableDeletedValue)
    78 {
    79 }
    8074
    8175template<class Encoder>
     
    115109    static WebCore::ServiceWorkerRegistrationKey emptyValue() { return WebCore::ServiceWorkerRegistrationKey::emptyKey(); }
    116110
    117     static void constructDeletedValue(WebCore::ServiceWorkerRegistrationKey& slot) { new (NotNull, &slot) WebCore::ServiceWorkerRegistrationKey(HashTableDeletedValue); }
    118     static bool isDeletedValue(const WebCore::ServiceWorkerRegistrationKey& slot) { return slot.isHashTableDeletedValue(); }
     111    static void constructDeletedValue(WebCore::ServiceWorkerRegistrationKey& slot) { new (NotNull, &slot.m_topOrigin) WebCore::SecurityOriginData(HashTableDeletedValue); }
     112    static bool isDeletedValue(const WebCore::ServiceWorkerRegistrationKey& slot) { return slot.m_topOrigin.isHashTableDeletedValue(); }
    119113};
    120114
Note: See TracChangeset for help on using the changeset viewer.