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

Side by Side Diff: Source/core/dom/AXObjectCache.h

Issue 1081673003: Oilpan: Prepare to move AXObjectCache to the heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | Source/core/dom/AXObjectCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 PassOwnPtr<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 PassOwnPtr<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 { 148 class CORE_EXPORT ScopedAXObjectCache : public NoBaseWillBeGarbageCollectedFinal ized<ScopedAXObjectCache> {
haraken 2015/05/28 08:57:57 Is ScopedAXObjectCache used in performance-sensiti
keishi 2015/05/29 09:00:57 Done.
145 WTF_MAKE_NONCOPYABLE(ScopedAXObjectCache); 149 WTF_MAKE_NONCOPYABLE(ScopedAXObjectCache);
146 public: 150 public:
147 static PassOwnPtr<ScopedAXObjectCache> create(Document&); 151 static PassOwnPtrWillBeRawPtr<ScopedAXObjectCache> create(Document&);
152 ~ScopedAXObjectCache();
153 DECLARE_TRACE();
154
155 void dispose();
148 156
149 AXObjectCache* get(); 157 AXObjectCache* get();
150 158
151 private: 159 private:
152 explicit ScopedAXObjectCache(Document&); 160 explicit ScopedAXObjectCache(Document&);
153 161
154 OwnPtr<AXObjectCache> m_ownedCache; 162 OwnPtrWillBeMember<AXObjectCache> m_ownedCache;
155 AXObjectCache* m_cache; 163 RawPtrWillBeMember<AXObjectCache> m_cache;
haraken 2015/05/28 08:57:57 If we keep ScopedAXObjectCache off-heap, we need t
164
165 #if ENABLE(ASSERT)
166 // Verified when finalizing.
167 bool m_hasBeenDisposed;
168 #endif
156 }; 169 };
157 170
158 } 171 }
159 172
160 #endif 173 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/AXObjectCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698