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

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

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add LocalFrame::detachView() + more Oilpan frame finalization comments 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 m_page = adoptPtrWillBeNoop(new Page(pageClients)); 227 m_page = adoptPtrWillBeNoop(new Page(pageClients));
228 m_page->settings().setScriptEnabled(true); 228 m_page->settings().setScriptEnabled(true);
229 m_page->settings().setAllowScriptsToCloseWindows(true); 229 m_page->settings().setAllowScriptsToCloseWindows(true);
230 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor()); 230 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor());
231 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi ceSupportsTouch()); 231 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi ceSupportsTouch());
232 // FIXME: Should we support enabling a11y while a popup is shown? 232 // FIXME: Should we support enabling a11y while a popup is shown?
233 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc essibilityEnabled()); 233 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc essibilityEnabled());
234 234
235 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); 235 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient()));
236 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClie nt(); 236 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClien t();
237 RefPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderClient, &m_pag e->frameHost(), 0); 237 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderCl ient, &m_page->frameHost(), 0);
238 frame->setPagePopupOwner(m_popupClient->ownerElement()); 238 frame->setPagePopupOwner(m_popupClient->ownerElement());
239 frame->setView(FrameView::create(frame.get())); 239 frame->setView(FrameView::create(frame.get()));
240 frame->init(); 240 frame->init();
241 frame->view()->resize(m_popupClient->contentSize()); 241 frame->view()->resize(m_popupClient->contentSize());
242 frame->view()->setTransparent(false); 242 frame->view()->setTransparent(false);
243 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing AXObjectCache()) 243 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing AXObjectCache())
244 cache->childrenChanged(&m_popupClient->ownerElement()); 244 cache->childrenChanged(&m_popupClient->ownerElement());
245 245
246 ASSERT(frame->domWindow()); 246 ASSERT(frame->domWindow());
247 DOMWindowPagePopup::install(*frame->domWindow(), m_popupClient); 247 DOMWindowPagePopup::install(*frame->domWindow(), m_popupClient);
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 // A WebPagePopupImpl instance usually has two references. 446 // A WebPagePopupImpl instance usually has two references.
447 // - One owned by the instance itself. It represents the visible widget. 447 // - One owned by the instance itself. It represents the visible widget.
448 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the 448 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
449 // WebPagePopupImpl to close. 449 // WebPagePopupImpl to close.
450 // We need them because the closing operation is asynchronous and the widget 450 // We need them because the closing operation is asynchronous and the widget
451 // can be closed while the WebViewImpl is unaware of it. 451 // can be closed while the WebViewImpl is unaware of it.
452 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 452 return adoptRef(new WebPagePopupImpl(client)).leakRef();
453 } 453 }
454 454
455 } // namespace blink 455 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698