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

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: 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) 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 26 matching lines...) Expand all
37 #include "core/frame/Settings.h" 37 #include "core/frame/Settings.h"
38 #include "core/loader/EmptyClients.h" 38 #include "core/loader/EmptyClients.h"
39 #include "core/loader/FrameLoadRequest.h" 39 #include "core/loader/FrameLoadRequest.h"
40 #include "core/page/Chrome.h" 40 #include "core/page/Chrome.h"
41 #include "core/page/DOMWindowPagePopup.h" 41 #include "core/page/DOMWindowPagePopup.h"
42 #include "core/page/EventHandler.h" 42 #include "core/page/EventHandler.h"
43 #include "core/page/FocusController.h" 43 #include "core/page/FocusController.h"
44 #include "core/page/Page.h" 44 #include "core/page/Page.h"
45 #include "core/page/PagePopupClient.h" 45 #include "core/page/PagePopupClient.h"
46 #include "platform/TraceEvent.h" 46 #include "platform/TraceEvent.h"
47 #include "platform/heap/Handle.h"
47 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" 48 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h"
48 #include "public/platform/WebCursorInfo.h" 49 #include "public/platform/WebCursorInfo.h"
49 #include "public/web/WebAXObject.h" 50 #include "public/web/WebAXObject.h"
50 #include "public/web/WebFrameClient.h" 51 #include "public/web/WebFrameClient.h"
51 #include "public/web/WebViewClient.h" 52 #include "public/web/WebViewClient.h"
52 #include "public/web/WebWidgetClient.h" 53 #include "public/web/WebWidgetClient.h"
53 #include "web/WebInputEventConversion.h" 54 #include "web/WebInputEventConversion.h"
54 #include "web/WebLocalFrameImpl.h" 55 #include "web/WebLocalFrameImpl.h"
55 #include "web/WebSettingsImpl.h" 56 #include "web/WebSettingsImpl.h"
56 #include "web/WebViewImpl.h" 57 #include "web/WebViewImpl.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 227
227 m_page = adoptPtrWillBeNoop(new Page(pageClients)); 228 m_page = adoptPtrWillBeNoop(new Page(pageClients));
228 m_page->settings().setScriptEnabled(true); 229 m_page->settings().setScriptEnabled(true);
229 m_page->settings().setAllowScriptsToCloseWindows(true); 230 m_page->settings().setAllowScriptsToCloseWindows(true);
230 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor()); 231 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor());
231 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi ceSupportsTouch()); 232 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi ceSupportsTouch());
232 // FIXME: Should we support enabling a11y while a popup is shown? 233 // FIXME: Should we support enabling a11y while a popup is shown?
233 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc essibilityEnabled()); 234 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc essibilityEnabled());
234 235
235 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); 236 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient()));
236 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClie nt(); 237 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClien t();
237 RefPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderClient, &m_pag e->frameHost(), 0); 238 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderCl ient, &m_page->frameHost(), 0);
238 frame->setPagePopupOwner(m_popupClient->ownerElement()); 239 frame->setPagePopupOwner(m_popupClient->ownerElement());
239 frame->setView(FrameView::create(frame.get())); 240 frame->setView(FrameView::create(frame.get()));
240 frame->init(); 241 frame->init();
241 frame->view()->resize(m_popupClient->contentSize()); 242 frame->view()->resize(m_popupClient->contentSize());
242 frame->view()->setTransparent(false); 243 frame->view()->setTransparent(false);
243 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing AXObjectCache()) 244 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing AXObjectCache())
244 cache->childrenChanged(&m_popupClient->ownerElement()); 245 cache->childrenChanged(&m_popupClient->ownerElement());
245 246
246 ASSERT(frame->domWindow()); 247 ASSERT(frame->domWindow());
247 DOMWindowPagePopup::install(*frame->domWindow(), m_popupClient); 248 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. 447 // A WebPagePopupImpl instance usually has two references.
447 // - One owned by the instance itself. It represents the visible widget. 448 // - 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 449 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
449 // WebPagePopupImpl to close. 450 // WebPagePopupImpl to close.
450 // We need them because the closing operation is asynchronous and the widget 451 // We need them because the closing operation is asynchronous and the widget
451 // can be closed while the WebViewImpl is unaware of it. 452 // can be closed while the WebViewImpl is unaware of it.
452 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 453 return adoptRef(new WebPagePopupImpl(client)).leakRef();
453 } 454 }
454 455
455 } // namespace blink 456 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698