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

Changeset 140393 in webkit


Ignore:
Timestamp:
Jan 22, 2013, 12:33:45 AM (14 years ago)
Author:
dmazzoni@google.com
Message:

AX: Should assert if we try to create two AXObjects that point to the same renderer or node
https://bugs.webkit.org/show_bug.cgi?id=107504

Reviewed by Chris Fleizach.

If two accessibility objects get created that point to the
same widget, renderer, or node, that can lead to crashes or
memory corruption later; make it assert instead of crashing.

  • accessibility/AXObjectCache.cpp:

(WebCore::AXObjectCache::getOrCreate):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140392 r140393  
     12013-01-22  Dominic Mazzoni  <dmazzoni@google.com>
     2
     3        AX: Should assert if we try to create two AXObjects that point to the same renderer or node
     4        https://bugs.webkit.org/show_bug.cgi?id=107504
     5
     6        Reviewed by Chris Fleizach.
     7
     8        If two accessibility objects get created that point to the
     9        same widget, renderer, or node, that can lead to crashes or
     10        memory corruption later; make it assert instead of crashing.
     11
     12        * accessibility/AXObjectCache.cpp:
     13        (WebCore::AXObjectCache::getOrCreate):
     14
    1152013-01-22  Kentaro Hara  <haraken@chromium.org>
    216
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r138916 r140393  
    306306    else if (widget->isScrollbar())
    307307        newObj = AccessibilityScrollbar::create(static_cast<Scrollbar*>(widget));
     308
     309    // Will crash later if we have two objects for the same widget.
     310    ASSERT(!get(widget));
    308311       
    309312    getAXID(newObj.get());
     
    338341    RefPtr<AccessibilityObject> newObj = createFromNode(node);
    339342
     343    // Will crash later if we have two objects for the same node.
     344    ASSERT(!get(node));
     345
    340346    getAXID(newObj.get());
    341347
     
    358364
    359365    RefPtr<AccessibilityObject> newObj = createFromRenderer(renderer);
     366
     367    // Will crash later if we have two objects for the same renderer.
     368    ASSERT(!get(renderer));
    360369
    361370    getAXID(newObj.get());
Note: See TracChangeset for help on using the changeset viewer.