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

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

Issue 1088473002: Refactor ScopedAXObjectCache to remove ref count (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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/accessibility/InspectorAccessibilityAgent.cpp
diff --git a/Source/modules/accessibility/InspectorAccessibilityAgent.cpp b/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
index fe1664975ef649c729a11bc6d63cb6b452e2ebc6..502278ade247a9e048f96fb639f9aa4ed5097f74 100644
--- a/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
+++ b/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
@@ -425,8 +425,10 @@ void InspectorAccessibilityAgent::getAXNode(ErrorString* errorString, int nodeId
if (!node)
return;
Document& document = node->document();
- RefPtr<ScopedAXObjectCache> cache(adoptRef(new ScopedAXObjectCache(document)));
- AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get());
+ 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.
+ return;
+ ScopedAXObjectCache cache(document);
+ AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache.get());
AXObject* axObject = cacheImpl->getOrCreate(node);
if (!axObject)
return;

Powered by Google App Engine
This is Rietveld 408576698