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

Side by Side Diff: Source/web/PopupContainer.cpp

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Back out non-Oilpan experiment + tidy up by adding frame() ref accessors Created 6 years, 3 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) 2011, Google Inc. All rights reserved. 2 * Copyright (c) 2011, Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 void PopupContainer::hidePopup() 233 void PopupContainer::hidePopup()
234 { 234 {
235 m_listBox->abandon(); 235 m_listBox->abandon();
236 } 236 }
237 237
238 void PopupContainer::notifyPopupHidden() 238 void PopupContainer::notifyPopupHidden()
239 { 239 {
240 if (!m_popupOpen) 240 if (!m_popupOpen)
241 return; 241 return;
242 m_popupOpen = false; 242 m_popupOpen = false;
243 WebViewImpl::fromPage(m_frameView->frame().page())->popupClosed(this); 243
244 // With Oilpan, we cannot assume that the FrameView's LocalFrame's
245 // page is still available, as the LocalFrame itself may have been
246 // detached from its FrameHost by now.
247 //
248 // So, if a popup menu is left in an open/shown state when
249 // finalized, the PopupMenu implementation of this container's
250 // listbox will hide itself when destructed, delivering the
251 // notifyPopupHidden() notification in the process & ending up here.
252 // If the LocalFrame has been detached already -- done when its
253 // HTMLFrameOwnerElement frame owner is detached as part of being
254 // torn down -- the connection to the FrameHost has been snipped &
255 // there's no page. Hence the null check.
256 //
257 // In a non-Oilpan setting, the RenderMenuList that controls/owns
258 // the PopupMenuChromium object and this PopupContainer is torn
259 // down and destructed before the frame and frame owner, hence the
260 // page will always be available in that setting and this will
261 // not be an issue.
262 if (WebViewImpl* webView = WebViewImpl::fromPage(m_frameView->frame().page() ))
263 webView->popupClosed(this);
244 } 264 }
245 265
246 void PopupContainer::fitToListBox() 266 void PopupContainer::fitToListBox()
247 { 267 {
248 // Place the listbox within our border. 268 // Place the listbox within our border.
249 m_listBox->move(borderSize, borderSize); 269 m_listBox->move(borderSize, borderSize);
250 270
251 // Size ourselves to contain listbox + border. 271 // Size ourselves to contain listbox + border.
252 resize(m_listBox->width() + borderSize * 2, m_listBox->height() + borderSize * 2); 272 resize(m_listBox->width() + borderSize * 2, m_listBox->height() + borderSize * 2);
253 invalidate(); 273 invalidate();
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 } 553 }
534 554
535 IntPoint PopupContainer::convertSelfToChild(const Widget* child, const IntPoint& point) const 555 IntPoint PopupContainer::convertSelfToChild(const Widget* child, const IntPoint& point) const
536 { 556 {
537 IntPoint newPoint = point; 557 IntPoint newPoint = point;
538 newPoint.moveBy(-child->location()); 558 newPoint.moveBy(-child->location());
539 return newPoint; 559 return newPoint;
540 } 560 }
541 561
542 } // namespace blink 562 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698