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

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

Issue 1053773002: Add WebScopedAXContext to allow a one-time snapshot of accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update other callers of ScopedAXObjectCache to use RefPtr 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
« no previous file with comments | « Source/core/dom/Element.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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 418
419 InspectorDOMAgent* domAgent = toLocalFrame(mainFrame)->instrumentingAgents() ->inspectorDOMAgent(); 419 InspectorDOMAgent* domAgent = toLocalFrame(mainFrame)->instrumentingAgents() ->inspectorDOMAgent();
420 if (!domAgent) { 420 if (!domAgent) {
421 *errorString = "DOM agent must be enabled"; 421 *errorString = "DOM agent must be enabled";
422 return; 422 return;
423 } 423 }
424 Node* node = domAgent->assertNode(errorString, nodeId); 424 Node* node = domAgent->assertNode(errorString, nodeId);
425 if (!node) 425 if (!node)
426 return; 426 return;
427 Document& document = node->document(); 427 Document& document = node->document();
428 ScopedAXObjectCache cache(document); 428 RefPtr<ScopedAXObjectCache> cache(adoptRef(new ScopedAXObjectCache(document) ));
429 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache.get()); 429 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get());
430 AXObject* axObject = cacheImpl->getOrCreate(node); 430 AXObject* axObject = cacheImpl->getOrCreate(node);
431 if (!axObject) 431 if (!axObject)
432 return; 432 return;
433 433
434 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro perty>::create(); 434 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro perty>::create();
435 fillLiveRegionProperties(axObject, properties); 435 fillLiveRegionProperties(axObject, properties);
436 fillGlobalStates(axObject, properties); 436 fillGlobalStates(axObject, properties);
437 fillWidgetProperties(axObject, properties); 437 fillWidgetProperties(axObject, properties);
438 fillWidgetStates(axObject, properties); 438 fillWidgetStates(axObject, properties);
439 fillRelationships(axObject, properties); 439 fillRelationships(axObject, properties);
440 440
441 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties ); 441 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties );
442 } 442 }
443 443
444 DEFINE_TRACE(InspectorAccessibilityAgent) 444 DEFINE_TRACE(InspectorAccessibilityAgent)
445 { 445 {
446 visitor->trace(m_page); 446 visitor->trace(m_page);
447 InspectorBaseAgent::trace(visitor); 447 InspectorBaseAgent::trace(visitor);
448 } 448 }
449 449
450 } // namespace blink 450 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/web/WebAXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698