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

Unified Diff: Source/web/WebAXObject.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/accessibility/InspectorAccessibilityAgent.cpp ('k') | public/web/WebAXObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebAXObject.cpp
diff --git a/Source/web/WebAXObject.cpp b/Source/web/WebAXObject.cpp
index 040c2bf15749a3f438a438418a5f82296abf1c79..17d202fc759988ddef6054338bf84814f474a922 100644
--- a/Source/web/WebAXObject.cpp
+++ b/Source/web/WebAXObject.cpp
@@ -33,7 +33,6 @@
#include "core/HTMLNames.h"
#include "core/css/CSSPrimitiveValueMappings.h"
-#include "core/dom/AXObjectCache.h"
#include "core/dom/Document.h"
#include "core/dom/Node.h"
#include "core/frame/FrameHost.h"
@@ -44,6 +43,7 @@
#include "core/page/EventHandler.h"
#include "core/page/Page.h"
#include "modules/accessibility/AXObject.h"
+#include "modules/accessibility/AXObjectCacheImpl.h"
#include "modules/accessibility/AXTable.h"
#include "modules/accessibility/AXTableCell.h"
#include "modules/accessibility/AXTableColumn.h"
@@ -71,6 +71,21 @@ static bool isLayoutClean(Document* document)
}
#endif
+WebScopedAXContext::WebScopedAXContext(WebDocument& rootDocument)
+ : m_private(adoptRef(new ScopedAXObjectCache(*rootDocument.unwrap<Document>())))
+{
+}
+
+WebScopedAXContext::~WebScopedAXContext()
+{
+ m_private.reset();
+}
+
+WebAXObject WebScopedAXContext::root() const
+{
+ return WebAXObject(static_cast<AXObjectCacheImpl*>(m_private->get())->root());
+}
+
void WebAXObject::reset()
{
m_private.reset();
« no previous file with comments | « Source/modules/accessibility/InspectorAccessibilityAgent.cpp ('k') | public/web/WebAXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698