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

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

Issue 2641323002: Migrate Timer to TaskRunnerTimer in AXObjectCacheImpl (Closed)
Patch Set: rebase Created 3 years, 11 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 | « third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h ('k') | no next file » | 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) 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 13 matching lines...) Expand all
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "modules/accessibility/AXObjectCacheImpl.h" 29 #include "modules/accessibility/AXObjectCacheImpl.h"
30 30
31 #include "core/HTMLNames.h" 31 #include "core/HTMLNames.h"
32 #include "core/InputTypeNames.h" 32 #include "core/InputTypeNames.h"
33 #include "core/dom/Document.h" 33 #include "core/dom/Document.h"
34 #include "core/dom/TaskRunnerHelper.h"
34 #include "core/editing/EditingUtilities.h" 35 #include "core/editing/EditingUtilities.h"
35 #include "core/frame/FrameView.h" 36 #include "core/frame/FrameView.h"
36 #include "core/frame/LocalFrame.h" 37 #include "core/frame/LocalFrame.h"
37 #include "core/frame/Settings.h" 38 #include "core/frame/Settings.h"
38 #include "core/html/HTMLAreaElement.h" 39 #include "core/html/HTMLAreaElement.h"
39 #include "core/html/HTMLCanvasElement.h" 40 #include "core/html/HTMLCanvasElement.h"
40 #include "core/html/HTMLImageElement.h" 41 #include "core/html/HTMLImageElement.h"
41 #include "core/html/HTMLInputElement.h" 42 #include "core/html/HTMLInputElement.h"
42 #include "core/html/HTMLLabelElement.h" 43 #include "core/html/HTMLLabelElement.h"
43 #include "core/html/HTMLOptionElement.h" 44 #include "core/html/HTMLOptionElement.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 using namespace HTMLNames; 87 using namespace HTMLNames;
87 88
88 // static 89 // static
89 AXObjectCache* AXObjectCacheImpl::create(Document& document) { 90 AXObjectCache* AXObjectCacheImpl::create(Document& document) {
90 return new AXObjectCacheImpl(document); 91 return new AXObjectCacheImpl(document);
91 } 92 }
92 93
93 AXObjectCacheImpl::AXObjectCacheImpl(Document& document) 94 AXObjectCacheImpl::AXObjectCacheImpl(Document& document)
94 : m_document(document), 95 : m_document(document),
95 m_modificationCount(0), 96 m_modificationCount(0),
96 m_notificationPostTimer(this, 97 m_notificationPostTimer(
97 &AXObjectCacheImpl::notificationPostTimerFired) { 98 TaskRunnerHelper::get(TaskType::UnspecedTimer, &document),
98 } 99 this,
100 &AXObjectCacheImpl::notificationPostTimerFired) {}
99 101
100 AXObjectCacheImpl::~AXObjectCacheImpl() { 102 AXObjectCacheImpl::~AXObjectCacheImpl() {
101 ASSERT(m_hasBeenDisposed); 103 ASSERT(m_hasBeenDisposed);
102 } 104 }
103 105
104 void AXObjectCacheImpl::dispose() { 106 void AXObjectCacheImpl::dispose() {
105 m_notificationPostTimer.stop(); 107 m_notificationPostTimer.stop();
106 108
107 for (auto& entry : m_objects) { 109 for (auto& entry : m_objects) {
108 AXObject* obj = entry.value; 110 AXObject* obj = entry.value;
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 visitor->trace(m_document); 1252 visitor->trace(m_document);
1251 visitor->trace(m_nodeObjectMapping); 1253 visitor->trace(m_nodeObjectMapping);
1252 1254
1253 visitor->trace(m_objects); 1255 visitor->trace(m_objects);
1254 visitor->trace(m_notificationsToPost); 1256 visitor->trace(m_notificationsToPost);
1255 1257
1256 AXObjectCache::trace(visitor); 1258 AXObjectCache::trace(visitor);
1257 } 1259 }
1258 1260
1259 } // namespace blink 1261 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698