Changeset 58220 in webkit
- Timestamp:
- Apr 24, 2010 10:53:24 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r58206 r58220 1 2010-04-24 Anton Muhin <antonm@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Allow to construct HashTraits<WebCore::QualifiedName>::constructDeletedValue 6 7 Former implementation attempted to use AtomicString(HashTableDeletedValue) 8 however those values cannot be used that way: one cannot construct 9 QualifiedNameImpl out of such AtomicString as we'll try to lookup this string 10 in the table, for example. 11 https://bugs.webkit.org/show_bug.cgi?id=37722 12 13 * wtf/RefPtr.h: expose hash table deleted value 14 1 15 2010-04-23 Sam Weinig <sam@webkit.org> 2 16 -
trunk/JavaScriptCore/wtf/RefPtr.h
r54724 r58220 80 80 void swap(RefPtr&); 81 81 82 static T* hashTableDeletedValue() { return reinterpret_cast<T*>(-1); } 83 82 84 private: 83 static T* hashTableDeletedValue() { return reinterpret_cast<T*>(-1); }84 85 85 T* m_ptr; 86 86 }; -
trunk/WebCore/ChangeLog
r58219 r58220 1 2010-04-24 Anton Muhin <antonm@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Allow to construct HashTraits<WebCore::QualifiedName>::constructDeletedValue 6 7 Former implementation attempted to use AtomicString(HashTableDeletedValue) 8 however those values cannot be used that way: one cannot construct 9 QualifiedNameImpl out of such AtomicString as we'll try to lookup this string 10 in the table, for example. 11 https://bugs.webkit.org/show_bug.cgi?id=37722 12 13 * dom/QualifiedName.cpp: 14 (WebCore::QualifiedName::deref): check that hash table deleted values never derefed 15 * dom/QualifiedName.h: 16 (WebCore::QualifiedName::QualifiedName): add a constructor to create hash table deleted values 17 (WebCore::QualifiedName::isHashTableDeletedValue): add a check if given instance is hash table deleted value 18 (WTF::): 19 1 20 2010-04-24 Julien Chaffraix <jchaffraix@webkit.org> 2 21 -
trunk/WebCore/dom/QualifiedName.cpp
r57904 r58220 79 79 return; 80 80 #endif 81 ASSERT(!isHashTableDeletedValue()); 81 82 82 83 if (m_impl->hasOneRef()) -
trunk/WebCore/dom/QualifiedName.h
r52280 r58220 59 59 QualifiedName(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI); 60 60 QualifiedName(const AtomicString& prefix, const char* localName, const AtomicString& namespaceURI); 61 QualifiedName(WTF::HashTableDeletedValueType) : m_impl(hashTableDeletedValue()) { } 62 bool isHashTableDeletedValue() const { return m_impl == hashTableDeletedValue(); } 61 63 ~QualifiedName() { deref(); } 62 64 #ifdef QNAME_DEFAULT_CONSTRUCTOR … … 93 95 void ref() const { m_impl->ref(); } 94 96 void deref(); 97 98 static QualifiedNameImpl* hashTableDeletedValue() { return RefPtr<QualifiedNameImpl>::hashTableDeletedValue(); } 95 99 96 100 QualifiedNameImpl* m_impl; … … 168 172 static const bool emptyValueIsZero = false; 169 173 static WebCore::QualifiedName emptyValue() { return WebCore::QualifiedName(WebCore::nullAtom, WebCore::nullAtom, WebCore::nullAtom); } 170 static void constructDeletedValue(WebCore::QualifiedName& slot) { new (&slot) WebCore::QualifiedName(W ebCore::nullAtom, WebCore::AtomicString(HashTableDeletedValue), WebCore::nullAtom); }171 static bool isDeletedValue(const WebCore::QualifiedName& slot) { return slot. localName().isHashTableDeletedValue(); }174 static void constructDeletedValue(WebCore::QualifiedName& slot) { new (&slot) WebCore::QualifiedName(WTF::HashTableDeletedValue); } 175 static bool isDeletedValue(const WebCore::QualifiedName& slot) { return slot.isHashTableDeletedValue(); } 172 176 }; 173 177 }
Note: See TracChangeset
for help on using the changeset viewer.