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

Unified Diff: Source/web/PopupListBox.cpp

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch LocalFrame::m_pluginElements rep to HashSet<HTMLPlugInElement*> Created 6 years, 2 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/web/PopupListBox.cpp
diff --git a/Source/web/PopupListBox.cpp b/Source/web/PopupListBox.cpp
index 8244e5621d35fdba0fe59cbbc5189d029d6290e7..d895c68fb509baefa77e8e5f0c0d3dc361380dbc 100644
--- a/Source/web/PopupListBox.cpp
+++ b/Source/web/PopupListBox.cpp
@@ -87,7 +87,22 @@ PopupListBox::~PopupListBox()
{
clear();
+ // Oilpan: the scrollbars of the ScrollView are self-sufficient,
+ // capable of detaching themselves from their animator on
+ // finalization.
+#if !ENABLE(OILPAN)
setHasVerticalScrollbar(false);
+#endif
+}
+
+void PopupListBox::trace(Visitor* visitor)
+{
+ visitor->trace(m_capturingScrollbar);
+ visitor->trace(m_lastScrollbarUnderMouse);
+ visitor->trace(m_focusedElement);
+ visitor->trace(m_container);
+ visitor->trace(m_verticalScrollbar);
+ Widget::trace(visitor);
}
bool PopupListBox::handleMouseDownEvent(const PlatformMouseEvent& event)
@@ -502,7 +517,7 @@ Font PopupListBox::getRowFont(int rowIndex) const
void PopupListBox::abandon()
{
- RefPtr<PopupListBox> keepAlive(this);
+ RefPtrWillBeRawPtr<PopupListBox> protect(this);
m_selectedIndex = m_originalIndex;
@@ -550,7 +565,7 @@ bool PopupListBox::acceptIndex(int index)
}
if (isSelectableItem(index)) {
- RefPtr<PopupListBox> keepAlive(this);
+ RefPtrWillBeRawPtr<PopupListBox> protect(this);
// Hide ourselves first since valueChanged may have numerous side-effects.
hidePopup();
@@ -835,8 +850,7 @@ void PopupListBox::layout()
void PopupListBox::clear()
{
- for (Vector<PopupItem*>::iterator it = m_items.begin(); it != m_items.end(); ++it)
- delete *it;
+ deleteAllValues(m_items);
m_items.clear();
}

Powered by Google App Engine
This is Rietveld 408576698