Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: Source/modules/accessibility/AXNodeObject.cpp

Issue 1072273006: Oilpan: Prepare moving AXObject to heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index 6953683de40d3d1f5a49d81e539a50450bf0f62f..ae9eba66488eff179659eb9ce08639418b902f4d 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -70,14 +70,14 @@ AXNodeObject::AXNodeObject(Node* node, AXObjectCacheImpl& axObjectCache)
{
}
-PassRefPtr<AXNodeObject> AXNodeObject::create(Node* node, AXObjectCacheImpl& axObjectCache)
+PassRefPtrWillBeRawPtr<AXNodeObject> AXNodeObject::create(Node* node, AXObjectCacheImpl& axObjectCache)
{
- return adoptRef(new AXNodeObject(node, axObjectCache));
+ return adoptRefWillBeNoop(new AXNodeObject(node, axObjectCache));
}
AXNodeObject::~AXNodeObject()
{
- ASSERT(isDetached());
+ ASSERT(!m_node);
}
// This function implements the ARIA accessible name as described by the Mozilla
@@ -755,9 +755,8 @@ void AXNodeObject::init()
void AXNodeObject::detach()
{
- clearChildren();
AXObject::detach();
- m_node = 0;
+ m_node = nullptr;
}
bool AXNodeObject::isAnchor() const
@@ -1777,7 +1776,7 @@ String AXNodeObject::computedName() const
// New AX name calculation.
//
-String AXNodeObject::textAlternative(bool recursive, bool inAriaLabelledByTraversal, HashSet<AXObject*>& visited, AXNameFrom* nameFrom, Vector<AXObject*>* nameObjects)
+String AXNodeObject::textAlternative(bool recursive, bool inAriaLabelledByTraversal, WillBeHeapHashSet<RawPtrWillBeMember<AXObject>>& visited, AXNameFrom* nameFrom, WillBeHeapVector<RawPtrWillBeMember<AXObject>>* nameObjects)
{
bool alreadyVisited = visited.contains(this);
visited.add(this);
@@ -1800,7 +1799,7 @@ String AXNodeObject::textAlternative(bool recursive, bool inAriaLabelledByTraver
ariaLabeledByElements(elements);
StringBuilder accumulatedText;
for (const auto& element : elements) {
- RefPtr<AXObject> axElement = axObjectCache().getOrCreate(element);
+ RefPtrWillBeRawPtr<AXObject> axElement = axObjectCache().getOrCreate(element);
if (axElement) {
if (nameObjects)
nameObjects->append(axElement.get());
@@ -2356,10 +2355,16 @@ void AXNodeObject::ariaLabeledByText(WillBeHeapVector<OwnPtrWillBeMember<Accessi
ariaLabeledByElements(elements);
for (const auto& element : elements) {
- RefPtr<AXObject> axElement = axObjectCache().getOrCreate(element);
+ RefPtrWillBeRawPtr<AXObject> axElement = axObjectCache().getOrCreate(element);
textOrder.append(AccessibilityText::create(ariaLabeledBy, AlternativeText, axElement));
}
}
}
+DEFINE_TRACE(AXNodeObject)
+{
+ visitor->trace(m_node);
+ AXObject::trace(visitor);
+}
+
} // namespace blink
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698