Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 (!document.axObjectCache()) |
|
haraken
2015/04/28 11:36:25
Why do we need an early return here? According to
keishi
2015/05/28 06:49:13
My mistake. Removed.
| |
| 429 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get()); | 429 return; |
| 430 ScopedAXObjectCache cache(document); | |
| 431 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache.get()); | |
| 430 AXObject* axObject = cacheImpl->getOrCreate(node); | 432 AXObject* axObject = cacheImpl->getOrCreate(node); |
| 431 if (!axObject) | 433 if (!axObject) |
| 432 return; | 434 return; |
| 433 | 435 |
| 434 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro perty>::create(); | 436 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro perty>::create(); |
| 435 fillLiveRegionProperties(axObject, properties); | 437 fillLiveRegionProperties(axObject, properties); |
| 436 fillGlobalStates(axObject, properties); | 438 fillGlobalStates(axObject, properties); |
| 437 fillWidgetProperties(axObject, properties); | 439 fillWidgetProperties(axObject, properties); |
| 438 fillWidgetStates(axObject, properties); | 440 fillWidgetStates(axObject, properties); |
| 439 fillRelationships(axObject, properties); | 441 fillRelationships(axObject, properties); |
| 440 | 442 |
| 441 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties ); | 443 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties ); |
| 442 } | 444 } |
| 443 | 445 |
| 444 DEFINE_TRACE(InspectorAccessibilityAgent) | 446 DEFINE_TRACE(InspectorAccessibilityAgent) |
| 445 { | 447 { |
| 446 visitor->trace(m_page); | 448 visitor->trace(m_page); |
| 447 InspectorBaseAgent::trace(visitor); | 449 InspectorBaseAgent::trace(visitor); |
| 448 } | 450 } |
| 449 | 451 |
| 450 } // namespace blink | 452 } // namespace blink |
| OLD | NEW |