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

Unified Diff: Source/web/PopupMenuChromium.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/PopupMenuChromium.cpp
diff --git a/Source/web/PopupMenuChromium.cpp b/Source/web/PopupMenuChromium.cpp
index 053e716d3572d27b36f9dfddafd539f269f46039..6896fbdbeff0bc4e603175adb0a003a0ab08e2f6 100644
--- a/Source/web/PopupMenuChromium.cpp
+++ b/Source/web/PopupMenuChromium.cpp
@@ -47,12 +47,29 @@ PopupMenuChromium::PopupMenuChromium(LocalFrame& frame, PopupMenuClient* client)
PopupMenuChromium::~PopupMenuChromium()
{
+#if ENABLE(OILPAN)
+ // Verify that dispose() has been called when disconnecting.
+ ASSERT(!m_popupClient);
+#else
+ dispose();
+#endif
+}
+
+void PopupMenuChromium::dispose()
+{
// When the PopupMenuChromium is destroyed, the client could already have been deleted.
if (m_popup)
m_popup->disconnectClient();
hide();
}
+void PopupMenuChromium::trace(Visitor* visitor)
+{
+ visitor->trace(m_frameView);
+ visitor->trace(m_popup);
+ PopupMenu::trace(visitor);
+}
+
void PopupMenuChromium::show(const FloatQuad& controlPosition, const IntSize& controlSize, int index)
{
if (!m_popup) {
@@ -77,6 +94,13 @@ void PopupMenuChromium::updateFromElement()
void PopupMenuChromium::disconnectClient()
{
m_popupClient = 0;
+#if ENABLE(OILPAN)
+ // Cannot be done during finalization, so instead done when the
+ // render object is destroyed and disconnected.
+ //
+ // FIXME: do this always, regardless of ENABLE(OILPAN).
+ dispose();
+#endif
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698