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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp

Issue 1207613004: Fix leaking AXNodeObjects when sub document detaches (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // There's no reason to clear our AXMenuListPopup child. If we get a 72 // There's no reason to clear our AXMenuListPopup child. If we get a
73 // call to clearChildren, it's because the options might have changed, 73 // call to clearChildren, it's because the options might have changed,
74 // so call it on our popup. 74 // so call it on our popup.
75 ASSERT(m_children.size() == 1); 75 ASSERT(m_children.size() == 1);
76 m_children[0]->clearChildren(); 76 m_children[0]->clearChildren();
77 m_childrenDirty = false; 77 m_childrenDirty = false;
78 } 78 }
79 79
80 void AXMenuList::addChildren() 80 void AXMenuList::addChildren()
81 { 81 {
82 ASSERT(!isDetached());
82 m_haveChildren = true; 83 m_haveChildren = true;
83 84
84 AXObjectCacheImpl& cache = axObjectCache(); 85 AXObjectCacheImpl& cache = axObjectCache();
85 86
86 AXObject* list = cache.getOrCreate(MenuListPopupRole); 87 AXObject* list = cache.getOrCreate(MenuListPopupRole);
87 if (!list) 88 if (!list)
88 return; 89 return;
89 90
90 toAXMockObject(list)->setParent(this); 91 toAXMockObject(list)->setParent(this);
91 if (list->accessibilityIsIgnored()) { 92 if (list->accessibilityIsIgnored()) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 return; 156 return;
156 157
157 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get()); 158 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get());
158 popup->didHide(); 159 popup->didHide();
159 160
160 if (node() && node()->focused()) 161 if (node() && node()->focused())
161 axObjectCache().postNotification(this, AXObjectCacheImpl::AXFocusedUIEle mentChanged); 162 axObjectCache().postNotification(this, AXObjectCacheImpl::AXFocusedUIEle mentChanged);
162 } 163 }
163 164
164 } // namespace blink 165 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698