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

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

Issue 1175533004: Refactor: Clear m_axObjectCache when AXObject detaches (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added ASSERT Created 5 years, 6 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/AXMenuListPopup.h ('k') | Source/modules/accessibility/AXMockObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXMenuListPopup.cpp
diff --git a/Source/modules/accessibility/AXMenuListPopup.cpp b/Source/modules/accessibility/AXMenuListPopup.cpp
index 9f19f278aad6a5233ab7bf48e36ff9dc7d1ca160..a24f425cbaa4e383d0768b40012adb7dc08935ff 100644
--- a/Source/modules/accessibility/AXMenuListPopup.cpp
+++ b/Source/modules/accessibility/AXMenuListPopup.cpp
@@ -34,7 +34,7 @@ namespace blink {
using namespace HTMLNames;
-AXMenuListPopup::AXMenuListPopup(AXObjectCacheImpl* axObjectCache)
+AXMenuListPopup::AXMenuListPopup(AXObjectCacheImpl& axObjectCache)
: AXMockObject(axObjectCache), m_activeIndex(-1)
{
}
@@ -71,7 +71,7 @@ AXMenuListOption* AXMenuListPopup::menuListOptionAXObject(HTMLElement* element)
if (!isHTMLOptionElement(*element))
return 0;
- AXObject* object = axObjectCache()->getOrCreate(element);
+ AXObject* object = axObjectCache().getOrCreate(element);
if (!object || !object->isMenuListOption())
return 0;
@@ -139,16 +139,16 @@ void AXMenuListPopup::didUpdateActiveOption(int optionIndex)
{
updateChildrenIfNecessary();
- AXObjectCacheImpl* cache = axObjectCache();
+ AXObjectCacheImpl& cache = axObjectCache();
if (m_activeIndex != optionIndex && m_activeIndex >= 0 && m_activeIndex < static_cast<int>(m_children.size())) {
RefPtr<AXObject> previousChild = m_children[m_activeIndex].get();
- cache->postNotification(previousChild.get(), AXObjectCacheImpl::AXMenuListItemUnselected);
+ cache.postNotification(previousChild.get(), AXObjectCacheImpl::AXMenuListItemUnselected);
}
if (optionIndex >= 0 && optionIndex < static_cast<int>(m_children.size())) {
RefPtr<AXObject> child = m_children[optionIndex].get();
- cache->postNotification(child.get(), AXObjectCacheImpl::AXFocusedUIElementChanged);
- cache->postNotification(child.get(), AXObjectCacheImpl::AXMenuListItemSelected);
+ cache.postNotification(child.get(), AXObjectCacheImpl::AXFocusedUIElementChanged);
+ cache.postNotification(child.get(), AXObjectCacheImpl::AXMenuListItemSelected);
}
m_activeIndex = optionIndex;
@@ -156,10 +156,10 @@ void AXMenuListPopup::didUpdateActiveOption(int optionIndex)
void AXMenuListPopup::didHide()
{
- AXObjectCacheImpl* cache = axObjectCache();
- cache->postNotification(this, AXObjectCacheImpl::AXHide);
+ AXObjectCacheImpl& cache = axObjectCache();
+ cache.postNotification(this, AXObjectCacheImpl::AXHide);
if (activeChild())
- cache->postNotification(activeChild(), AXObjectCacheImpl::AXMenuListItemUnselected);
+ cache.postNotification(activeChild(), AXObjectCacheImpl::AXMenuListItemUnselected);
}
void AXMenuListPopup::didShow()
@@ -167,13 +167,13 @@ void AXMenuListPopup::didShow()
if (!m_haveChildren)
addChildren();
- AXObjectCacheImpl* cache = axObjectCache();
- cache->postNotification(this, AXObjectCacheImpl::AXShow);
+ AXObjectCacheImpl& cache = axObjectCache();
+ cache.postNotification(this, AXObjectCacheImpl::AXShow);
int selectedIndex = getSelectedIndex();
if (selectedIndex >= 0 && selectedIndex < static_cast<int>(m_children.size()))
didUpdateActiveOption(selectedIndex);
else
- cache->postNotification(m_parent, AXObjectCacheImpl::AXFocusedUIElementChanged);
+ cache.postNotification(m_parent, AXObjectCacheImpl::AXFocusedUIElementChanged);
}
AXObject* AXMenuListPopup::activeChild()
« no previous file with comments | « Source/modules/accessibility/AXMenuListPopup.h ('k') | Source/modules/accessibility/AXMockObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698