Ignore:
Timestamp:
Apr 12, 2011, 4:48:11 PM (14 years ago)
Author:
[email protected]
Message:

2011-04-12 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Make API callback objects use weak handles to run their finalizers
https://bugs.webkit.org/show_bug.cgi?id=58389

Make the API object's private data struct act as a finalizer for
an api object if the callback object has a API defined finalizer.

  • API/JSCallbackObject.cpp: (JSC::JSCallbackObjectData::finalize):
  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h: (JSC::::init):
  • heap/Handle.h:

2011-04-12 Geoffrey Garen <[email protected]>

Reviewed by Geoffrey Garen.

Cleaned up hash traits, and added hash traits for handles
https://bugs.webkit.org/show_bug.cgi?id=58381

  • dom/QualifiedName.h: Use new SimpleClassHashTraits to avoid duplication.
  • platform/KURL.h: (WebCore::KURL::KURL): (WebCore::KURL::isHashTableDeletedValue): Added explicit hash table deleted value constructor, to be more explicit and enable use of SimpleClassHashTraits.
  • platform/KURLHash.h: Use new SimpleClassHashTraits to avoid duplication.
  • platform/graphics/FontCache.cpp: Ditto.
  • platform/network/ProtectionSpaceHash.h: Ditto.
  • svg/properties/SVGAnimatedPropertyDescription.h: Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wtf/RetainPtr.h

    r79434 r83664  
    235235    }
    236236   
    237     template<typename P> struct HashTraits<RetainPtr<P> > : GenericHashTraits<RetainPtr<P> > {
    238         static const bool emptyValueIsZero = true;
    239         static void constructDeletedValue(RetainPtr<P>& slot) { new (&slot) RetainPtr<P>(HashTableDeletedValue); }
    240         static bool isDeletedValue(const RetainPtr<P>& value) { return value == reinterpret_cast<P*>(-1); }
    241     };
     237    template<typename P> struct HashTraits<RetainPtr<P> > : SimpleClassHashTraits<RetainPtr<P> > { };
    242238   
    243239    template<typename P> struct PtrHash<RetainPtr<P> > : PtrHash<P*> {
Note: See TracChangeset for help on using the changeset viewer.