Chromium Code Reviews| Index: Source/modules/accessibility/AXObject.h |
| diff --git a/Source/modules/accessibility/AXObject.h b/Source/modules/accessibility/AXObject.h |
| index a02bc6331fdfb487c536a7a05d2cdd7f49627c13..3f64ea95a7ba74d01df4b3c9980dd7cf928e051b 100644 |
| --- a/Source/modules/accessibility/AXObject.h |
| +++ b/Source/modules/accessibility/AXObject.h |
| @@ -220,7 +220,7 @@ public: |
| { |
| return adoptPtrWillBeNoop(new AccessibilityText(text, source, nullptr)); |
| } |
| - static PassOwnPtrWillBeRawPtr<AccessibilityText> create(const String& text, const AccessibilityTextSource& source, const RefPtr<AXObject> element) |
| + static PassOwnPtrWillBeRawPtr<AccessibilityText> create(const String& text, const AccessibilityTextSource& source, const RefPtrWillBeRawPtr<AXObject> element) |
| { |
| return adoptPtrWillBeNoop(new AccessibilityText(text, source, nullptr)); |
| } |
| @@ -229,10 +229,12 @@ public: |
| AccessibilityTextSource textSource() const { return m_textSource; } |
| AXObject* textElement() const { return m_textElement.get(); } |
| - DEFINE_INLINE_TRACE() { } |
| + DEFINE_INLINE_TRACE() { |
|
haraken
2015/06/23 06:33:29
Nit: { should go to the next line.
keishi
2015/06/24 05:08:21
Done.
|
| + visitor->trace(m_textElement); |
| + } |
| private: |
| - AccessibilityText(const String& text, const AccessibilityTextSource& source, const PassRefPtr<AXObject> element) |
| + AccessibilityText(const String& text, const AccessibilityTextSource& source, const RefPtrWillBeRawPtr<AXObject> element) |
| : m_text(text) |
| , m_textSource(source) |
| , m_textElement(element) |
| @@ -240,7 +242,7 @@ private: |
| String m_text; |
| AccessibilityTextSource m_textSource; |
| - RefPtr<AXObject> m_textElement; |
| + RefPtrWillBeMember<AXObject> m_textElement; |
| }; |
| enum AccessibilityOrientation { |
| @@ -363,9 +365,9 @@ struct IgnoredReason { |
| { } |
| }; |
| -class MODULES_EXPORT AXObject : public RefCounted<AXObject> { |
| +class MODULES_EXPORT AXObject : public RefCountedWillBeGarbageCollectedFinalized<AXObject> { |
| public: |
| - typedef Vector<RefPtr<AXObject>> AccessibilityChildrenVector; |
| + typedef WillBeHeapVector<RefPtrWillBeMember<AXObject>> AccessibilityChildrenVector; |
| struct PlainTextRange { |
| @@ -390,6 +392,7 @@ protected: |
| public: |
| virtual ~AXObject(); |
| + DECLARE_VIRTUAL_TRACE(); |
| // After constructing an AXObject, it must be given a |
| // unique ID, then added to AXObjectCacheImpl, and finally init() must |
| @@ -544,13 +547,13 @@ public: |
| // Retrieves the accessible name of the object, an enum indicating where the name |
| // was derived from, and a list of objects that were used to derive the name, if any. |
| - virtual String name(AXNameFrom&, Vector<AXObject*>& nameObjects); |
| + virtual String name(AXNameFrom&, WillBeHeapVector<RawPtrWillBeMember<AXObject>>& nameObjects); |
| // Takes the result of nameFrom from calling |name|, above, and retrieves the |
| // accessible description of the object, which is secondary to |name|, an enum indicating |
| // where the description was derived from, and a list of objects that were used to |
| // derive the description, if any. |
| - virtual String description(AXNameFrom, AXDescriptionFrom&, Vector<AXObject*>& descriptionObjects) { return String(); } |
| + virtual String description(AXNameFrom, AXDescriptionFrom&, WillBeHeapVector<RawPtrWillBeMember<AXObject>>& descriptionObjects) { return String(); } |
| // Takes the result of nameFrom and descriptionFrom from calling |name| and |description|, |
| // above, and retrieves the placeholder of the object, if present and if it wasn't already |
| @@ -558,7 +561,7 @@ public: |
| virtual String placeholder(AXNameFrom, AXDescriptionFrom) { return String(); } |
| // Internal function used by name and description, above. |
| - virtual String textAlternative(bool recursive, bool inAriaLabelledByTraversal, HashSet<AXObject*>& visited, AXNameFrom*, Vector<AXObject*>* nameObjects) { return String(); } |
| + virtual String textAlternative(bool recursive, bool inAriaLabelledByTraversal, WillBeHeapHashSet<RawPtrWillBeMember<AXObject>>& visited, AXNameFrom*, WillBeHeapVector<RawPtrWillBeMember<AXObject>>* nameObjects) { return String(); } |
| // Returns result of Accessible Name Calculation algorithm. |
| // This is a simpler high-level interface to |name| used by Inspector. |
| @@ -784,7 +787,9 @@ protected: |
| unsigned getLengthForTextRange() const { return text().length(); } |
| - mutable AXObject* m_parent; |
| + bool m_detached; |
| + |
| + mutable RawPtrWillBeMember<AXObject> m_parent; |
| // The following cached attribute values (the ones starting with m_cached*) |
| // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modificationCount(). |
| @@ -795,9 +800,9 @@ protected: |
| mutable bool m_cachedIsDescendantOfDisabledNode : 1; |
| mutable bool m_cachedHasInheritedPresentationalRole : 1; |
| mutable bool m_cachedIsPresentationalChild : 1; |
| - mutable const AXObject* m_cachedLiveRegionRoot; |
| + mutable RawPtrWillBeMember<const AXObject> m_cachedLiveRegionRoot; |
| - AXObjectCacheImpl* m_axObjectCache; |
| + RawPtrWillBeMember<AXObjectCacheImpl> m_axObjectCache; |
| // Updates the cached attribute values. This may be recursive, so to prevent deadlocks, |
| // functions called here may only search up the tree (ancestors), not down. |