Skip to content
  • darin@apple.com's avatar
    JavaScriptCore: · 387d7a0e
    darin@apple.com authored
            Reviewed by Maciej.
    
            - http://bugs.webkit.org/show_bug.cgi?id=15807
              HashMap needs a take() function that combines get and remove
    
            * wtf/HashMap.h: Added take function. Simplistic implementation for now,
            but still does only one hash table lookup.
    
            * kjs/array_instance.cpp: (KJS::ArrayInstance::put): Use take rather than
            a find followed by a remove.
    
    WebCore:
    
            Reviewed by Maciej.
    
            - use the new HashMap::take function where appropriate
    
            * bindings/js/kjs_binding.cpp:
            (KJS::addWrapper): Made an inline rather than a macro; inlines good, macros bad.
            (KJS::removeWrapper): Ditto.
            (KJS::removeWrappers): Ditto.
            (KJS::ScriptInterpreter::putDOMObject): Use the inline instead of the macro.
            (KJS::ScriptInterpreter::forgetDOMObject): Ditto. This involves using take instead
            of remove -- in theory ever so slightly less efficient, but I think it's fine.
            (KJS::ScriptInterpreter::forgetDOMNodeForDocument): Ditto.
            (KJS::ScriptInterpreter::putDOMNodeForDocument): Use the inline instead of the macro.
            (KJS::ScriptInterpreter::forgetAllDOMNodesForDocument): Use take instead of find/remove.
            (KJS::ScriptInterpreter::updateDOMNodeDocument): Use the inlines instead of the macros.
    
            * bindings/js/kjs_window.cpp: (KJS::Window::clearTimeout): Use take instead of find/remove.
            * bridge/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::remove): Ditto.
            * page/AnimationController.cpp: (WebCore::AnimationControllerPrivate::clear): Ditto.
            * rendering/RenderBlock.cpp:
            (WebCore::RenderBlock::~RenderBlock): Ditto.
            (WebCore::RenderBlock::setDesiredColumnCountAndWidth): Ditto.
            * rendering/RootInlineBox.cpp: Ditto.(WebCore::RootInlineBox::detachEllipsisBox): Ditto.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    387d7a0e