Index: third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp |
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp |
index 0e5d71f0738b04a9bdf5c30dfaf17b824a125cc6..5d3737cc53ce60ff3655fb128402bc3b6aee262d 100644 |
--- a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp |
+++ b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp |
@@ -380,31 +380,24 @@ InspectorAccessibilityAgent::InspectorAccessibilityAgent( |
InspectorDOMAgent* domAgent) |
: m_page(page), m_domAgent(domAgent) {} |
-void InspectorAccessibilityAgent::getAXNodeChain( |
- ErrorString* errorString, |
+Response InspectorAccessibilityAgent::getAXNodeChain( |
int domNodeId, |
bool fetchAncestors, |
std::unique_ptr<protocol::Array<protocol::Accessibility::AXNode>>* nodes) { |
- if (!m_domAgent->enabled()) { |
- *errorString = "DOM agent must be enabled"; |
- return; |
- } |
+ if (!m_domAgent->enabled()) |
+ return Response::Error("DOM agent must be enabled"); |
Node* domNode = nullptr; |
Response response = m_domAgent->assertNode(domNodeId, domNode); |
- if (!response.isSuccess()) { |
- *errorString = response.errorMessage(); |
- return; |
- } |
+ if (!response.isSuccess()) |
+ return response; |
Document& document = domNode->document(); |
document.updateStyleAndLayoutIgnorePendingStylesheets(); |
DocumentLifecycle::DisallowTransitionScope disallowTransition( |
document.lifecycle()); |
LocalFrame* localFrame = document.frame(); |
- if (!localFrame) { |
- *errorString = "Frame is detached."; |
- return; |
- } |
+ if (!localFrame) |
+ return Response::Error("Frame is detached."); |
std::unique_ptr<ScopedAXObjectCache> scopedCache = |
ScopedAXObjectCache::create(document); |
AXObjectCacheImpl* cache = toAXObjectCacheImpl(scopedCache->get()); |
@@ -424,6 +417,7 @@ void InspectorAccessibilityAgent::getAXNodeChain( |
parent = parent->parentObjectUnignored(); |
} |
} |
+ return Response::OK(); |
} |
std::unique_ptr<AXNode> InspectorAccessibilityAgent::buildObjectForIgnoredNode( |