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

Side by Side Diff: Source/core/dom/AXObjectCache.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2011 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 22 matching lines...) Expand all
33 33
34 namespace blink { 34 namespace blink {
35 class AXObject; 35 class AXObject;
36 class FrameView; 36 class FrameView;
37 class HTMLOptionElement; 37 class HTMLOptionElement;
38 class HTMLSelectElement; 38 class HTMLSelectElement;
39 class LayoutMenuList; 39 class LayoutMenuList;
40 class Page; 40 class Page;
41 class Widget; 41 class Widget;
42 42
43 class CORE_EXPORT AXObjectCache { 43 class CORE_EXPORT AXObjectCache : public NoBaseWillBeGarbageCollectedFinalized<A XObjectCache> {
44 WTF_MAKE_NONCOPYABLE(AXObjectCache); WTF_MAKE_FAST_ALLOCATED(AXObjectCache); 44 WTF_MAKE_NONCOPYABLE(AXObjectCache);
45 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(AXObjectCache);
45 public: 46 public:
46 static AXObjectCache* create(Document&); 47 static PassOwnPtrWillBeRawPtr<AXObjectCache> create(Document&);
47 48
48 static AXObject* focusedUIElementForPage(const Page*); 49 static AXObject* focusedUIElementForPage(const Page*);
49 50
50 virtual ~AXObjectCache(); 51 virtual ~AXObjectCache();
52 DEFINE_INLINE_VIRTUAL_TRACE() { }
51 53
52 enum AXNotification { 54 enum AXNotification {
53 AXActiveDescendantChanged, 55 AXActiveDescendantChanged,
54 AXAlert, 56 AXAlert,
55 AXAriaAttributeChanged, 57 AXAriaAttributeChanged,
56 AXAutocorrectionOccured, 58 AXAutocorrectionOccured,
57 AXBlur, 59 AXBlur,
58 AXCheckedStateChanged, 60 AXCheckedStateChanged,
59 AXChildrenChanged, 61 AXChildrenChanged,
60 AXFocusedUIElementChanged, 62 AXFocusedUIElementChanged,
(...skipping 13 matching lines...) Expand all
74 AXScrolledToAnchor, 76 AXScrolledToAnchor,
75 AXSelectedChildrenChanged, 77 AXSelectedChildrenChanged,
76 AXSelectedTextChanged, 78 AXSelectedTextChanged,
77 AXShow, 79 AXShow,
78 AXTextChanged, 80 AXTextChanged,
79 AXTextInserted, 81 AXTextInserted,
80 AXTextRemoved, 82 AXTextRemoved,
81 AXValueChanged 83 AXValueChanged
82 }; 84 };
83 85
86 virtual void dispose() = 0;
87
84 virtual void selectionChanged(Node*) = 0; 88 virtual void selectionChanged(Node*) = 0;
85 virtual void childrenChanged(Node*) = 0; 89 virtual void childrenChanged(Node*) = 0;
86 virtual void childrenChanged(LayoutObject*) = 0; 90 virtual void childrenChanged(LayoutObject*) = 0;
87 virtual void checkedStateChanged(Node*) = 0; 91 virtual void checkedStateChanged(Node*) = 0;
88 virtual void listboxOptionStateChanged(HTMLOptionElement*) = 0; 92 virtual void listboxOptionStateChanged(HTMLOptionElement*) = 0;
89 virtual void listboxSelectedChildrenChanged(HTMLSelectElement*) = 0; 93 virtual void listboxSelectedChildrenChanged(HTMLSelectElement*) = 0;
90 virtual void listboxActiveIndexChanged(HTMLSelectElement*) = 0; 94 virtual void listboxActiveIndexChanged(HTMLSelectElement*) = 0;
91 95
92 virtual void remove(LayoutObject*) = 0; 96 virtual void remove(LayoutObject*) = 0;
93 virtual void remove(Node*) = 0; 97 virtual void remove(Node*) = 0;
(...skipping 30 matching lines...) Expand all
124 virtual void handleScrollPositionChanged(LayoutObject*) = 0; 128 virtual void handleScrollPositionChanged(LayoutObject*) = 0;
125 129
126 // Called when scroll bars are added / removed (as the view resizes). 130 // Called when scroll bars are added / removed (as the view resizes).
127 virtual void handleScrollbarUpdate(FrameView*) = 0; 131 virtual void handleScrollbarUpdate(FrameView*) = 0;
128 virtual void handleLayoutComplete(LayoutObject*) = 0; 132 virtual void handleLayoutComplete(LayoutObject*) = 0;
129 virtual void handleScrolledToAnchor(const Node* anchorNode) = 0; 133 virtual void handleScrolledToAnchor(const Node* anchorNode) = 0;
130 134
131 virtual const AtomicString& computedRoleForNode(Node*) = 0; 135 virtual const AtomicString& computedRoleForNode(Node*) = 0;
132 virtual String computedNameForNode(Node*) = 0; 136 virtual String computedNameForNode(Node*) = 0;
133 137
134 typedef AXObjectCache* (*AXObjectCacheCreateFunction)(Document&); 138 typedef PassOwnPtrWillBeRawPtr<AXObjectCache> (*AXObjectCacheCreateFunction) (Document&);
135 static void init(AXObjectCacheCreateFunction); 139 static void init(AXObjectCacheCreateFunction);
136 140
137 protected: 141 protected:
138 AXObjectCache(); 142 AXObjectCache();
139 143
140 private: 144 private:
141 static AXObjectCacheCreateFunction m_createFunction; 145 static AXObjectCacheCreateFunction m_createFunction;
142 }; 146 };
143 147
144 class CORE_EXPORT ScopedAXObjectCache : public RefCounted<ScopedAXObjectCache> { 148 class CORE_EXPORT ScopedAXObjectCache {
145 WTF_MAKE_NONCOPYABLE(ScopedAXObjectCache); 149 WTF_MAKE_NONCOPYABLE(ScopedAXObjectCache);
146 public: 150 public:
147 explicit ScopedAXObjectCache(Document&); 151 explicit ScopedAXObjectCache(Document&);
148 ~ScopedAXObjectCache(); 152 ~ScopedAXObjectCache();
149 153
150 AXObjectCache* get(); 154 AXObjectCache* get();
151 AXObjectCache* operator->(); 155 AXObjectCache* operator->();
152 156
153 private: 157 private:
154 Document& m_document; 158 #if ENABLE(OILPAN)
155 AXObjectCache* m_cache; 159 bool m_isOwned;
156 bool m_isScoped; 160 #else
161 OwnPtr<AXObjectCache> m_ownedCache;
dmazzoni 2015/04/28 06:53:25 any reason not to just use m_isOwned for the non-o
keishi 2015/05/28 06:49:19 Nope removed.
162 #endif
163 RawPtrWillBePersistent<AXObjectCache> m_cache;
157 }; 164 };
158 165
159 } 166 }
160 167
161 #endif 168 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/AXObjectCache.cpp » ('j') | Source/modules/accessibility/AXNodeObject.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698