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

Unified Diff: Source/modules/accessibility/AXObjectCacheImpl.h

Issue 1072273006: Oilpan: Prepare moving AXObject to heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
Index: Source/modules/accessibility/AXObjectCacheImpl.h
diff --git a/Source/modules/accessibility/AXObjectCacheImpl.h b/Source/modules/accessibility/AXObjectCacheImpl.h
index 7899f4993dda4e6cad6535f401d05d6f09614b00..d2bf3359fec84c98de63e5d37a982fe3632ff669 100644
--- a/Source/modules/accessibility/AXObjectCacheImpl.h
+++ b/Source/modules/accessibility/AXObjectCacheImpl.h
@@ -55,15 +55,19 @@ struct TextMarkerData {
// This class should only be used from inside the accessibility directory.
class MODULES_EXPORT AXObjectCacheImpl : public AXObjectCache {
- WTF_MAKE_NONCOPYABLE(AXObjectCacheImpl); WTF_MAKE_FAST_ALLOCATED(AXObjectCacheImpl);
+ WTF_MAKE_NONCOPYABLE(AXObjectCacheImpl);
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(AXObjectCacheImpl);
public:
- static AXObjectCache* create(Document&);
+ static PassOwnPtrWillBeRawPtr<AXObjectCache> create(Document&);
explicit AXObjectCacheImpl(Document&);
~AXObjectCacheImpl();
+ DECLARE_VIRTUAL_TRACE();
AXObject* focusedUIElementForPage(const Page*);
+ virtual void dispose() override;
+
virtual void selectionChanged(Node*) override;
virtual void childrenChanged(Node*) override;
virtual void childrenChanged(LayoutObject*) override;
@@ -134,7 +138,11 @@ public:
AXObject* firstAccessibleObjectFromNode(const Node*);
+#if ENABLE(OILPAN)
+ void remove(AXObject*);
dmazzoni 2015/04/28 06:53:25 Can we make this change for the non-oilpan compile
keishi 2015/05/28 06:49:19 Done.
+#else
void remove(AXID);
+#endif
void remove(AbstractInlineTextBox*);
void childrenChanged(AXObject*);
@@ -149,7 +157,9 @@ public:
bool accessibilityEnabled();
bool inlineTextBoxAccessibilityEnabled();
+#if !ENABLE(OILPAN)
void removeAXID(AXObject*);
+#endif
bool isIDinUse(AXID id) const { return m_idsInUse.contains(id); }
AXID platformGenerateAXID() const;
@@ -172,24 +182,35 @@ protected:
void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); }
bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); }
- PassRefPtr<AXObject> createFromRenderer(LayoutObject*);
- PassRefPtr<AXObject> createFromNode(Node*);
- PassRefPtr<AXObject> createFromInlineTextBox(AbstractInlineTextBox*);
+ PassRefPtrWillBeRawPtr<AXObject> createFromRenderer(LayoutObject*);
+ PassRefPtrWillBeRawPtr<AXObject> createFromNode(Node*);
+ PassRefPtrWillBeRawPtr<AXObject> createFromInlineTextBox(AbstractInlineTextBox*);
private:
+ void removeAXID(AXID);
+
Document& m_document;
+
+#if ENABLE(OILPAN)
+ HeapHashMap<AXID, WeakMember<AXObject>> m_objects;
+ HeapHashMap<LayoutObject*, Member<AXObject>> m_layoutObjectMapping;
+ HeapHashMap<WeakMember<Widget>, Member<AXObject>> m_widgetObjectMapping;
+ HeapHashMap<WeakMember<Node>, Member<AXObject>> m_nodeObjectMapping;
dmazzoni 2015/04/28 06:53:25 I'm worried about WeakMember<Node> here. We rely o
keishi 2015/05/28 06:49:19 HeapHashMap with WeakMember entries will automatic
+ HeapHashMap<AbstractInlineTextBox*, Member<AXObject>> m_inlineTextBoxObjectMapping;
+#else
HashMap<AXID, RefPtr<AXObject>> m_objects;
HashMap<LayoutObject*, AXID> m_layoutObjectMapping;
HashMap<Widget*, AXID> m_widgetObjectMapping;
HashMap<Node*, AXID> m_nodeObjectMapping;
HashMap<AbstractInlineTextBox*, AXID> m_inlineTextBoxObjectMapping;
- HashSet<Node*> m_textMarkerNodes;
+#endif
+ WillBeHeapHashSet<RawPtrWillBeWeakMember<Node>> m_textMarkerNodes;
int m_modificationCount;
HashSet<AXID> m_idsInUse;
Timer<AXObjectCacheImpl> m_notificationPostTimer;
- Vector<pair<RefPtr<AXObject>, AXNotification>> m_notificationsToPost;
+ WillBeHeapVector<pair<RefPtrWillBeMember<AXObject>, AXNotification>> m_notificationsToPost;
void notificationPostTimerFired(Timer<AXObjectCacheImpl>*);
AXObject* focusedImageMapUIElement(HTMLAreaElement*);

Powered by Google App Engine
This is Rietveld 408576698