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

Side by Side Diff: Source/modules/accessibility/InspectorAccessibilityAgent.cpp

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 | « Source/modules/accessibility/AXObjectCacheImpl.cpp ('k') | Source/web/WebAXObject.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "modules/accessibility/InspectorAccessibilityAgent.h" 7 #include "modules/accessibility/InspectorAccessibilityAgent.h"
8 8
9 #include "core/dom/AXObjectCache.h" 9 #include "core/dom/AXObjectCache.h"
10 #include "core/dom/DOMNodeIds.h" 10 #include "core/dom/DOMNodeIds.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 InspectorDOMAgent* domAgent = toLocalFrame(mainFrame)->instrumentingAgents() ->inspectorDOMAgent(); 349 InspectorDOMAgent* domAgent = toLocalFrame(mainFrame)->instrumentingAgents() ->inspectorDOMAgent();
350 if (!domAgent) { 350 if (!domAgent) {
351 *errorString = "DOM agent must be enabled"; 351 *errorString = "DOM agent must be enabled";
352 return; 352 return;
353 } 353 }
354 Node* node = domAgent->assertNode(errorString, nodeId); 354 Node* node = domAgent->assertNode(errorString, nodeId);
355 if (!node) 355 if (!node)
356 return; 356 return;
357 357
358 Document& document = node->document(); 358 Document& document = node->document();
359 RefPtr<ScopedAXObjectCache> cache(adoptRef(new ScopedAXObjectCache(document) )); 359 OwnPtr<ScopedAXObjectCache> cache = ScopedAXObjectCache::create(document);
360 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get()); 360 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get());
361 AXObject* axObject = cacheImpl->getOrCreate(node); 361 AXObject* axObject = cacheImpl->getOrCreate(node);
362 if (!axObject || axObject->accessibilityIsIgnored()) { 362 if (!axObject || axObject->accessibilityIsIgnored()) {
363 accessibilityNode = buildObjectForIgnoredNode(node, axObject, cacheImpl) ; 363 accessibilityNode = buildObjectForIgnoredNode(node, axObject, cacheImpl) ;
364 return; 364 return;
365 } 365 }
366 366
367 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro perty>::create(); 367 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro perty>::create();
368 fillLiveRegionProperties(axObject, properties); 368 fillLiveRegionProperties(axObject, properties);
369 fillGlobalStates(axObject, properties); 369 fillGlobalStates(axObject, properties);
370 fillWidgetProperties(axObject, properties); 370 fillWidgetProperties(axObject, properties);
371 fillWidgetStates(axObject, properties); 371 fillWidgetStates(axObject, properties);
372 fillRelationships(axObject, properties); 372 fillRelationships(axObject, properties);
373 373
374 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties ); 374 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties );
375 } 375 }
376 376
377 DEFINE_TRACE(InspectorAccessibilityAgent) 377 DEFINE_TRACE(InspectorAccessibilityAgent)
378 { 378 {
379 visitor->trace(m_page); 379 visitor->trace(m_page);
380 InspectorBaseAgent::trace(visitor); 380 InspectorBaseAgent::trace(visitor);
381 } 381 }
382 382
383 } // namespace blink 383 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXObjectCacheImpl.cpp ('k') | Source/web/WebAXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698