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

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

Issue 1072273006: Oilpan: Prepare moving AXObject to heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
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 RefPtr<ScopedAXObjectCache> cache(adoptRef(new ScopedAXObjectCache(document) )); 428 #if ENABLE(OILPAN)
429 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get()); 429 if (!document.axObjectCache())
430 return;
431 ScopedAXObjectCache cache(document);
432 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache.get());
433 #else
434 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(document.axObjectCache()) ;
435 if (!cacheImpl)
436 return;
437 #endif
430 AXObject* axObject = cacheImpl->getOrCreate(node); 438 AXObject* axObject = cacheImpl->getOrCreate(node);
431 if (!axObject) 439 if (!axObject)
432 return; 440 return;
433 441
434 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro perty>::create(); 442 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro perty>::create();
435 fillLiveRegionProperties(axObject, properties); 443 fillLiveRegionProperties(axObject, properties);
436 fillGlobalStates(axObject, properties); 444 fillGlobalStates(axObject, properties);
437 fillWidgetProperties(axObject, properties); 445 fillWidgetProperties(axObject, properties);
438 fillWidgetStates(axObject, properties); 446 fillWidgetStates(axObject, properties);
439 fillRelationships(axObject, properties); 447 fillRelationships(axObject, properties);
440 448
441 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties ); 449 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties );
442 } 450 }
443 451
444 DEFINE_TRACE(InspectorAccessibilityAgent) 452 DEFINE_TRACE(InspectorAccessibilityAgent)
445 { 453 {
446 visitor->trace(m_page); 454 visitor->trace(m_page);
447 InspectorBaseAgent::trace(visitor); 455 InspectorBaseAgent::trace(visitor);
448 } 456 }
449 457
450 } // namespace blink 458 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698