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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 { 95 {
96 if (!m_parent) 96 if (!m_parent)
97 return false; 97 return false;
98 98
99 m_parent->press(); 99 m_parent->press();
100 return true; 100 return true;
101 } 101 }
102 102
103 void AXMenuListPopup::addChildren() 103 void AXMenuListPopup::addChildren()
104 { 104 {
105 ASSERT(!isDetached());
105 if (!m_parent) 106 if (!m_parent)
106 return; 107 return;
107 108
108 Node* parentNode = m_parent->node(); 109 Node* parentNode = m_parent->node();
109 if (!isHTMLSelectElement(parentNode)) 110 if (!isHTMLSelectElement(parentNode))
110 return; 111 return;
111 112
112 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode); 113 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode);
113 m_haveChildren = true; 114 m_haveChildren = true;
114 115
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 179
179 AXObject* AXMenuListPopup::activeChild() 180 AXObject* AXMenuListPopup::activeChild()
180 { 181 {
181 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size() )) 182 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size() ))
182 return nullptr; 183 return nullptr;
183 184
184 return m_children[m_activeIndex].get(); 185 return m_children[m_activeIndex].get();
185 } 186 }
186 187
187 } // namespace blink 188 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698