Changeset 241495 in webkit


Ignore:
Timestamp:
Feb 13, 2019 7:38:40 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Crash when inspecting an element that constantly changes visibility
https://bugs.webkit.org/show_bug.cgi?id=194632
<rdar://problem/48060258>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2019-02-13
Reviewed by Matt Baker and Devin Rousso.

  • inspector/agents/InspectorDOMAgent.h:
  • inspector/agents/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::processAccessibilityChildren):
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
Don't use rvalue-references as that was taking ownership and deleting
the object we want to keep around. Instead simplify this to just use
references so no ref counting changes happen.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r241494 r241495  
     12019-02-13  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Crash when inspecting an element that constantly changes visibility
     4        https://bugs.webkit.org/show_bug.cgi?id=194632
     5        <rdar://problem/48060258>
     6
     7        Reviewed by Matt Baker and Devin Rousso.
     8
     9        * inspector/agents/InspectorDOMAgent.h:
     10        * inspector/agents/InspectorDOMAgent.cpp:
     11        (WebCore::InspectorDOMAgent::processAccessibilityChildren):
     12        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
     13        Don't use rvalue-references as that was taking ownership and deleting
     14        the object we want to keep around. Instead simplify this to just use
     15        references so no ref counting changes happen.
     16
    1172019-02-13  Chris Fleizach  <cfleizach@apple.com>
    218
  • trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp

    r241110 r241495  
    17431743    return value;
    17441744}
    1745    
    1746 void InspectorDOMAgent::processAccessibilityChildren(RefPtr<AccessibilityObject>&& axObject, RefPtr<JSON::ArrayOf<int>>&& childNodeIds)
    1747 {
    1748     const auto& children = axObject->children();
     1745
     1746void InspectorDOMAgent::processAccessibilityChildren(AccessibilityObject& axObject, JSON::ArrayOf<int>& childNodeIds)
     1747{
     1748    const auto& children = axObject.children();
    17491749    if (!children.size())
    17501750        return;
    1751    
    1752     if (!childNodeIds)
    1753         childNodeIds = JSON::ArrayOf<int>::create();
    1754    
     1751
    17551752    for (const auto& childObject : children) {
    17561753        if (Node* childNode = childObject->node())
    1757             childNodeIds->addItem(pushNodePathToFrontend(childNode));
     1754            childNodeIds.addItem(pushNodePathToFrontend(childNode));
    17581755        else
    1759             processAccessibilityChildren(childObject.copyRef(), childNodeIds.copyRef());
     1756            processAccessibilityChildren(*childObject, childNodeIds);
    17601757    }
    17611758}
     
    18331830            }
    18341831           
    1835             processAccessibilityChildren(axObject, WTFMove(childNodeIds));
     1832            if (!axObject->children().isEmpty()) {
     1833                childNodeIds = JSON::ArrayOf<int>::create();
     1834                processAccessibilityChildren(*axObject, *childNodeIds);
     1835            }
    18361836           
    18371837            Vector<Element*> controlledElements;
  • trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h

    r239183 r241495  
    249249    Ref<Inspector::Protocol::DOM::EventListener> buildObjectForEventListener(const RegisteredEventListener&, int identifier, const AtomicString& eventType, Node*, const String* objectGroupId, bool disabled, bool hasBreakpoint);
    250250    RefPtr<Inspector::Protocol::DOM::AccessibilityProperties> buildObjectForAccessibilityProperties(Node*);
    251     void processAccessibilityChildren(RefPtr<AccessibilityObject>&&, RefPtr<JSON::ArrayOf<int>>&&);
     251    void processAccessibilityChildren(AccessibilityObject&, JSON::ArrayOf<int>&);
    252252   
    253253    Node* nodeForPath(const String& path);
Note: See TracChangeset for help on using the changeset viewer.