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

Side by Side 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: Add ~Scrollbar assert 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 29 matching lines...) Expand all
40 namespace blink { 40 namespace blink {
41 41
42 PopupMenuChromium::PopupMenuChromium(LocalFrame& frame, PopupMenuClient* client) 42 PopupMenuChromium::PopupMenuChromium(LocalFrame& frame, PopupMenuClient* client)
43 : m_popupClient(client) 43 : m_popupClient(client)
44 , m_frameView(frame.view()) 44 , m_frameView(frame.view())
45 { 45 {
46 } 46 }
47 47
48 PopupMenuChromium::~PopupMenuChromium() 48 PopupMenuChromium::~PopupMenuChromium()
49 { 49 {
50 #if !ENABLE(OILPAN)
haraken 2014/09/29 14:16:37 Can we add an assert to oilpan builds to verify th
sof 2014/10/02 14:03:54 Done.
51 dispose();
52 #endif
53 }
54
55 void PopupMenuChromium::dispose()
56 {
50 // When the PopupMenuChromium is destroyed, the client could already have be en deleted. 57 // When the PopupMenuChromium is destroyed, the client could already have be en deleted.
51 if (m_popup) 58 if (m_popup)
52 m_popup->disconnectClient(); 59 m_popup->disconnectClient();
53 hide(); 60 hide();
54 } 61 }
55 62
63 void PopupMenuChromium::trace(Visitor* visitor)
64 {
65 visitor->trace(m_frameView);
66 visitor->trace(m_popup);
67 PopupMenu::trace(visitor);
68 }
69
56 void PopupMenuChromium::show(const FloatQuad& controlPosition, const IntSize& co ntrolSize, int index) 70 void PopupMenuChromium::show(const FloatQuad& controlPosition, const IntSize& co ntrolSize, int index)
57 { 71 {
58 if (!m_popup) { 72 if (!m_popup) {
59 bool deviceSupportsTouch = m_frameView->frame().settings()->deviceSuppor tsTouch(); 73 bool deviceSupportsTouch = m_frameView->frame().settings()->deviceSuppor tsTouch();
60 m_popup = PopupContainer::create(m_popupClient, deviceSupportsTouch); 74 m_popup = PopupContainer::create(m_popupClient, deviceSupportsTouch);
61 } 75 }
62 m_popup->showInRect(controlPosition, controlSize, m_frameView.get(), index); 76 m_popup->showInRect(controlPosition, controlSize, m_frameView.get(), index);
63 } 77 }
64 78
65 void PopupMenuChromium::hide() 79 void PopupMenuChromium::hide()
66 { 80 {
67 if (m_popup) 81 if (m_popup)
68 m_popup->hide(); 82 m_popup->hide();
69 } 83 }
70 84
71 void PopupMenuChromium::updateFromElement() 85 void PopupMenuChromium::updateFromElement()
72 { 86 {
73 m_popup->updateFromElement(); 87 m_popup->updateFromElement();
74 } 88 }
75 89
76 90
77 void PopupMenuChromium::disconnectClient() 91 void PopupMenuChromium::disconnectClient()
78 { 92 {
79 m_popupClient = 0; 93 m_popupClient = 0;
94 #if ENABLE(OILPAN)
95 // Cannot be done during finalization, so instead done when the
96 // render object is destroyed and disconnected.
97 dispose();
haraken 2014/09/29 14:16:37 How about making non-oilpan builds call dispose()
sof 2014/10/02 14:03:54 That's always preferable and I suspect that might
98 #endif
80 } 99 }
81 100
82 } // namespace blink 101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698