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

Unified Diff: third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp

Issue 2468233003: [DevTools] Migrate Accessibility, Log, Worker to new style (Closed)
Patch Set: addressed comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698