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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014, Google Inc. All rights reserved. 2 * Copyright (C) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 AXObject* getOrCreate(AbstractInlineTextBox*); 131 AXObject* getOrCreate(AbstractInlineTextBox*);
132 132
133 // will only return the AXObject if it already exists 133 // will only return the AXObject if it already exists
134 AXObject* get(Node*); 134 AXObject* get(Node*);
135 AXObject* get(LayoutObject*); 135 AXObject* get(LayoutObject*);
136 AXObject* get(Widget*); 136 AXObject* get(Widget*);
137 AXObject* get(AbstractInlineTextBox*); 137 AXObject* get(AbstractInlineTextBox*);
138 138
139 AXObject* firstAccessibleObjectFromNode(const Node*); 139 AXObject* firstAccessibleObjectFromNode(const Node*);
140 140
141 #if ENABLE(OILPAN)
142 void remove(AXObject*);
143 #else
141 void remove(AXID); 144 void remove(AXID);
145 #endif
142 void remove(AbstractInlineTextBox*); 146 void remove(AbstractInlineTextBox*);
143 147
144 void childrenChanged(AXObject*); 148 void childrenChanged(AXObject*);
145 149
146 void handleActiveDescendantChanged(Node*); 150 void handleActiveDescendantChanged(Node*);
147 void handleAriaRoleChanged(Node*); 151 void handleAriaRoleChanged(Node*);
148 void handleAriaExpandedChange(Node*); 152 void handleAriaExpandedChange(Node*);
149 void handleAriaSelectedChanged(Node*); 153 void handleAriaSelectedChanged(Node*);
150 154
151 void recomputeIsIgnored(LayoutObject*); 155 void recomputeIsIgnored(LayoutObject*);
152 156
153 bool accessibilityEnabled(); 157 bool accessibilityEnabled();
154 bool inlineTextBoxAccessibilityEnabled(); 158 bool inlineTextBoxAccessibilityEnabled();
155 159
160 #if !ENABLE(OILPAN)
156 void removeAXID(AXObject*); 161 void removeAXID(AXObject*);
162 #endif
157 bool isIDinUse(AXID id) const { return m_idsInUse.contains(id); } 163 bool isIDinUse(AXID id) const { return m_idsInUse.contains(id); }
158 164
159 AXID platformGenerateAXID() const; 165 AXID platformGenerateAXID() const;
160 166
161 // Counts the number of times the document has been modified. Some attribute values are cached 167 // Counts the number of times the document has been modified. Some attribute values are cached
162 // as long as the modification count hasn't changed. 168 // as long as the modification count hasn't changed.
163 int modificationCount() const { return m_modificationCount; } 169 int modificationCount() const { return m_modificationCount; }
164 170
165 void postNotification(LayoutObject*, AXNotification); 171 void postNotification(LayoutObject*, AXNotification);
166 void postNotification(Node*, AXNotification); 172 void postNotification(Node*, AXNotification);
167 void postNotification(AXObject*, AXNotification); 173 void postNotification(AXObject*, AXNotification);
168 174
169 protected: 175 protected:
170 void postPlatformNotification(AXObject*, AXNotification); 176 void postPlatformNotification(AXObject*, AXNotification);
171 void textChanged(AXObject*); 177 void textChanged(AXObject*);
172 void labelChanged(Element*); 178 void labelChanged(Element*);
173 179
174 // This is a weak reference cache for knowing if Nodes used by TextMarkers a re valid. 180 // This is a weak reference cache for knowing if Nodes used by TextMarkers a re valid.
175 void setNodeInUse(Node* n) { m_textMarkerNodes.add(n); } 181 void setNodeInUse(Node* n) { m_textMarkerNodes.add(n); }
176 void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); } 182 void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); }
177 bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); } 183 bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); }
178 184
179 PassRefPtr<AXObject> createFromRenderer(LayoutObject*); 185 PassRefPtrWillBeRawPtr<AXObject> createFromRenderer(LayoutObject*);
180 PassRefPtr<AXObject> createFromNode(Node*); 186 PassRefPtrWillBeRawPtr<AXObject> createFromNode(Node*);
181 PassRefPtr<AXObject> createFromInlineTextBox(AbstractInlineTextBox*); 187 PassRefPtrWillBeRawPtr<AXObject> createFromInlineTextBox(AbstractInlineTextB ox*);
182 188
183 private: 189 private:
190 void removeAXID(AXID);
191
184 Document& m_document; 192 Document& m_document;
haraken 2015/05/28 10:48:41 This should be Member<Document>.
keishi 2015/06/08 06:27:21 Done.
193
194 #if ENABLE(OILPAN)
195 HeapHashMap<AXID, WeakMember<AXObject>> m_objects;
haraken 2015/05/28 10:48:41 Why isn't this a HeapHashMap<AXID, Member<AXObject
keishi 2015/06/08 06:27:21 Done.
196 HeapHashMap<LayoutObject*, Member<AXObject>> m_layoutObjectMapping;
197 HeapHashMap<WeakMember<Widget>, Member<AXObject>> m_widgetObjectMapping;
198 HeapHashMap<WeakMember<Node>, Member<AXObject>> m_nodeObjectMapping;
199 HeapHashMap<AbstractInlineTextBox*, Member<AXObject>> m_inlineTextBoxObjectM apping;
200 #else
185 HashMap<AXID, RefPtr<AXObject>> m_objects; 201 HashMap<AXID, RefPtr<AXObject>> m_objects;
186 HashMap<LayoutObject*, AXID> m_layoutObjectMapping; 202 HashMap<LayoutObject*, AXID> m_layoutObjectMapping;
187 HashMap<Widget*, AXID> m_widgetObjectMapping; 203 HashMap<Widget*, AXID> m_widgetObjectMapping;
188 HashMap<Node*, AXID> m_nodeObjectMapping; 204 HashMap<Node*, AXID> m_nodeObjectMapping;
189 HashMap<AbstractInlineTextBox*, AXID> m_inlineTextBoxObjectMapping; 205 HashMap<AbstractInlineTextBox*, AXID> m_inlineTextBoxObjectMapping;
haraken 2015/05/28 10:48:41 It is a bit unfortunate (and makes it harder to ve
keishi 2015/06/08 06:27:21 Done.
190 HashSet<Node*> m_textMarkerNodes; 206 #endif
207 WillBeHeapHashSet<RawPtrWillBeWeakMember<Node>> m_textMarkerNodes;
191 int m_modificationCount; 208 int m_modificationCount;
192 209
193 HashSet<AXID> m_idsInUse; 210 HashSet<AXID> m_idsInUse;
194 211
195 #if ENABLE(ASSERT) 212 #if ENABLE(ASSERT)
196 // Verified when finalizing. 213 // Verified when finalizing.
197 bool m_hasBeenDisposed; 214 bool m_hasBeenDisposed;
198 #endif 215 #endif
199 216
200 // 217 //
(...skipping 17 matching lines...) Expand all
218 // exist in the tree. 235 // exist in the tree.
219 HashMap<AXID, HashSet<String>> m_ariaOwnerToIdsMapping; 236 HashMap<AXID, HashSet<String>> m_ariaOwnerToIdsMapping;
220 237
221 // Map from an ID (the ID attribute of a DOM element) to the set of elements that 238 // Map from an ID (the ID attribute of a DOM element) to the set of elements that
222 // want to own that ID. This is *unvalidated*, it includes possible duplicat es. 239 // want to own that ID. This is *unvalidated*, it includes possible duplicat es.
223 // This is used so that when an element with an ID is added to the tree or c hanges 240 // This is used so that when an element with an ID is added to the tree or c hanges
224 // its ID, we can quickly determine if it affects an aria-owns relationship. 241 // its ID, we can quickly determine if it affects an aria-owns relationship.
225 HashMap<String, OwnPtr<HashSet<AXID>>> m_idToAriaOwnersMapping; 242 HashMap<String, OwnPtr<HashSet<AXID>>> m_idToAriaOwnersMapping;
226 243
227 Timer<AXObjectCacheImpl> m_notificationPostTimer; 244 Timer<AXObjectCacheImpl> m_notificationPostTimer;
228 Vector<pair<RefPtr<AXObject>, AXNotification>> m_notificationsToPost; 245 WillBeHeapVector<pair<RefPtrWillBeMember<AXObject>, AXNotification>> m_notif icationsToPost;
229 void notificationPostTimerFired(Timer<AXObjectCacheImpl>*); 246 void notificationPostTimerFired(Timer<AXObjectCacheImpl>*);
230 247
231 AXObject* focusedImageMapUIElement(HTMLAreaElement*); 248 AXObject* focusedImageMapUIElement(HTMLAreaElement*);
232 249
233 AXID getAXID(AXObject*); 250 AXID getAXID(AXObject*);
234 251
235 void textChanged(Node*); 252 void textChanged(Node*);
236 bool nodeIsTextControl(const Node*); 253 bool nodeIsTextControl(const Node*);
237 254
238 Settings* settings(); 255 Settings* settings();
239 }; 256 };
240 257
241 // This is the only subclass of AXObjectCache. 258 // This is the only subclass of AXObjectCache.
242 DEFINE_TYPE_CASTS(AXObjectCacheImpl, AXObjectCache, cache, true, true); 259 DEFINE_TYPE_CASTS(AXObjectCacheImpl, AXObjectCache, cache, true, true);
243 260
244 bool nodeHasRole(Node*, const String& role); 261 bool nodeHasRole(Node*, const String& role);
245 // This will let you know if aria-hidden was explicitly set to false. 262 // This will let you know if aria-hidden was explicitly set to false.
246 bool isNodeAriaVisible(Node*); 263 bool isNodeAriaVisible(Node*);
247 264
248 } 265 }
249 266
250 #endif 267 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698