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

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

Issue 1088473002: Refactor ScopedAXObjectCache to remove ref count (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed m_ownedCache init 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 25 matching lines...) Expand all
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 {
44 WTF_MAKE_NONCOPYABLE(AXObjectCache); WTF_MAKE_FAST_ALLOCATED(AXObjectCache); 44 WTF_MAKE_NONCOPYABLE(AXObjectCache); WTF_MAKE_FAST_ALLOCATED(AXObjectCache);
45 public: 45 public:
46 static AXObjectCache* create(Document&); 46 static PassOwnPtr<AXObjectCache> create(Document&);
47 47
48 static AXObject* focusedUIElementForPage(const Page*); 48 static AXObject* focusedUIElementForPage(const Page*);
49 49
50 virtual ~AXObjectCache(); 50 virtual ~AXObjectCache();
51 51
52 enum AXNotification { 52 enum AXNotification {
53 AXActiveDescendantChanged, 53 AXActiveDescendantChanged,
54 AXAlert, 54 AXAlert,
55 AXAriaAttributeChanged, 55 AXAriaAttributeChanged,
56 AXAutocorrectionOccured, 56 AXAutocorrectionOccured,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 virtual void handleScrollPositionChanged(LayoutObject*) = 0; 124 virtual void handleScrollPositionChanged(LayoutObject*) = 0;
125 125
126 // Called when scroll bars are added / removed (as the view resizes). 126 // Called when scroll bars are added / removed (as the view resizes).
127 virtual void handleScrollbarUpdate(FrameView*) = 0; 127 virtual void handleScrollbarUpdate(FrameView*) = 0;
128 virtual void handleLayoutComplete(LayoutObject*) = 0; 128 virtual void handleLayoutComplete(LayoutObject*) = 0;
129 virtual void handleScrolledToAnchor(const Node* anchorNode) = 0; 129 virtual void handleScrolledToAnchor(const Node* anchorNode) = 0;
130 130
131 virtual const AtomicString& computedRoleForNode(Node*) = 0; 131 virtual const AtomicString& computedRoleForNode(Node*) = 0;
132 virtual String computedNameForNode(Node*) = 0; 132 virtual String computedNameForNode(Node*) = 0;
133 133
134 typedef AXObjectCache* (*AXObjectCacheCreateFunction)(Document&); 134 typedef PassOwnPtr<AXObjectCache> (*AXObjectCacheCreateFunction)(Document&);
135 static void init(AXObjectCacheCreateFunction); 135 static void init(AXObjectCacheCreateFunction);
136 136
137 protected: 137 protected:
138 AXObjectCache(); 138 AXObjectCache();
139 139
140 private: 140 private:
141 static AXObjectCacheCreateFunction m_createFunction; 141 static AXObjectCacheCreateFunction m_createFunction;
142 }; 142 };
143 143
144 class CORE_EXPORT ScopedAXObjectCache : public RefCounted<ScopedAXObjectCache> { 144 class CORE_EXPORT ScopedAXObjectCache {
145 WTF_MAKE_NONCOPYABLE(ScopedAXObjectCache); 145 WTF_MAKE_NONCOPYABLE(ScopedAXObjectCache);
146 public: 146 public:
147 explicit ScopedAXObjectCache(Document&); 147 static PassOwnPtr<ScopedAXObjectCache> create(Document&);
148 ~ScopedAXObjectCache();
149 148
150 AXObjectCache* get(); 149 AXObjectCache* get();
151 AXObjectCache* operator->();
152 150
153 private: 151 private:
154 Document& m_document; 152 explicit ScopedAXObjectCache(Document&);
153
154 OwnPtr<AXObjectCache> m_ownedCache;
155 AXObjectCache* m_cache; 155 AXObjectCache* m_cache;
156 bool m_isScoped;
157 }; 156 };
158 157
159 } 158 }
160 159
161 #endif 160 #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