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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 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 18 matching lines...) Expand all
29 #ifndef AXObjectCacheImpl_h 29 #ifndef AXObjectCacheImpl_h
30 #define AXObjectCacheImpl_h 30 #define AXObjectCacheImpl_h
31 31
32 #include "core/dom/AXObjectCache.h" 32 #include "core/dom/AXObjectCache.h"
33 #include "modules/ModulesExport.h" 33 #include "modules/ModulesExport.h"
34 #include "modules/accessibility/AXObject.h" 34 #include "modules/accessibility/AXObject.h"
35 #include "platform/Timer.h" 35 #include "platform/Timer.h"
36 #include "wtf/Forward.h" 36 #include "wtf/Forward.h"
37 #include "wtf/HashMap.h" 37 #include "wtf/HashMap.h"
38 #include "wtf/HashSet.h" 38 #include "wtf/HashSet.h"
39 #include <memory>
40 39
41 namespace blink { 40 namespace blink {
42 41
43 class AbstractInlineTextBox; 42 class AbstractInlineTextBox;
44 class HTMLAreaElement; 43 class HTMLAreaElement;
45 class FrameView; 44 class FrameView;
46 45
47 // This class should only be used from inside the accessibility directory. 46 // This class should only be used from inside the accessibility directory.
48 class MODULES_EXPORT AXObjectCacheImpl : public AXObjectCache { 47 class MODULES_EXPORT AXObjectCacheImpl : public AXObjectCache {
49 WTF_MAKE_NONCOPYABLE(AXObjectCacheImpl); 48 WTF_MAKE_NONCOPYABLE(AXObjectCacheImpl);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 220
222 // Map from the AXID of any object with an aria-owns attribute to the set of ids 221 // Map from the AXID of any object with an aria-owns attribute to the set of ids
223 // of its children. This is *unvalidated*, it includes ids that may not curr ently 222 // of its children. This is *unvalidated*, it includes ids that may not curr ently
224 // exist in the tree. 223 // exist in the tree.
225 HashMap<AXID, HashSet<String>> m_ariaOwnerToIdsMapping; 224 HashMap<AXID, HashSet<String>> m_ariaOwnerToIdsMapping;
226 225
227 // Map from an ID (the ID attribute of a DOM element) to the set of elements that 226 // Map from an ID (the ID attribute of a DOM element) to the set of elements that
228 // want to own that ID. This is *unvalidated*, it includes possible duplicat es. 227 // want to own that ID. This is *unvalidated*, it includes possible duplicat es.
229 // This is used so that when an element with an ID is added to the tree or c hanges 228 // This is used so that when an element with an ID is added to the tree or c hanges
230 // its ID, we can quickly determine if it affects an aria-owns relationship. 229 // its ID, we can quickly determine if it affects an aria-owns relationship.
231 HashMap<String, std::unique_ptr<HashSet<AXID>>> m_idToAriaOwnersMapping; 230 HashMap<String, OwnPtr<HashSet<AXID>>> m_idToAriaOwnersMapping;
232 231
233 Timer<AXObjectCacheImpl> m_notificationPostTimer; 232 Timer<AXObjectCacheImpl> m_notificationPostTimer;
234 HeapVector<std::pair<Member<AXObject>, AXNotification>> m_notificationsToPos t; 233 HeapVector<std::pair<Member<AXObject>, AXNotification>> m_notificationsToPos t;
235 void notificationPostTimerFired(Timer<AXObjectCacheImpl>*); 234 void notificationPostTimerFired(Timer<AXObjectCacheImpl>*);
236 235
237 AXObject* focusedImageMapUIElement(HTMLAreaElement*); 236 AXObject* focusedImageMapUIElement(HTMLAreaElement*);
238 237
239 AXID getAXID(AXObject*); 238 AXID getAXID(AXObject*);
240 239
241 void textChanged(Node*); 240 void textChanged(Node*);
242 bool nodeIsTextControl(const Node*); 241 bool nodeIsTextControl(const Node*);
243 242
244 Settings* settings(); 243 Settings* settings();
245 }; 244 };
246 245
247 // This is the only subclass of AXObjectCache. 246 // This is the only subclass of AXObjectCache.
248 DEFINE_TYPE_CASTS(AXObjectCacheImpl, AXObjectCache, cache, true, true); 247 DEFINE_TYPE_CASTS(AXObjectCacheImpl, AXObjectCache, cache, true, true);
249 248
250 bool nodeHasRole(Node*, const String& role); 249 bool nodeHasRole(Node*, const String& role);
251 // This will let you know if aria-hidden was explicitly set to false. 250 // This will let you know if aria-hidden was explicitly set to false.
252 bool isNodeAriaVisible(Node*); 251 bool isNodeAriaVisible(Node*);
253 252
254 } // namespace blink 253 } // namespace blink
255 254
256 #endif 255 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698