Changeset 276499 in webkit
- Timestamp:
- Apr 23, 2021, 8:40:24 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
workers/service/ServiceWorkerRegistrationKey.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r276497 r276499 1 2021-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 1 17 2021-04-23 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h
r276361 r276499 36 36 public: 37 37 ServiceWorkerRegistrationKey() = default; 38 explicit ServiceWorkerRegistrationKey(WTF::HashTableDeletedValueType);39 38 WEBCORE_EXPORT ServiceWorkerRegistrationKey(SecurityOriginData&& topOrigin, URL&& scope); 40 39 … … 67 66 #endif 68 67 69 bool isHashTableDeletedValue() const { return m_topOrigin.isHashTableDeletedValue(); } 68 private: 69 friend struct HashTraits<ServiceWorkerRegistrationKey>; 70 70 71 private:72 71 SecurityOriginData m_topOrigin; 73 72 URL m_scope; 74 73 }; 75 76 inline ServiceWorkerRegistrationKey::ServiceWorkerRegistrationKey(WTF::HashTableDeletedValueType)77 : m_topOrigin(WTF::HashTableDeletedValue)78 {79 }80 74 81 75 template<class Encoder> … … 115 109 static WebCore::ServiceWorkerRegistrationKey emptyValue() { return WebCore::ServiceWorkerRegistrationKey::emptyKey(); } 116 110 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(); } 119 113 }; 120 114
Note:
See TracChangeset
for help on using the changeset viewer.