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

Unified Diff: Source/web/FrameLoaderClientImpl.cpp

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Support renderer-less plugin disposal 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/FrameLoaderClientImpl.cpp
diff --git a/Source/web/FrameLoaderClientImpl.cpp b/Source/web/FrameLoaderClientImpl.cpp
index dfaa9ec8e58bee949a28f6b4fc1328517b87c543..93742830d0ef6b6c999f1c6e53e720ecb562deea 100644
--- a/Source/web/FrameLoaderClientImpl.cpp
+++ b/Source/web/FrameLoaderClientImpl.cpp
@@ -633,7 +633,7 @@ bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp
return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType);
}
-PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
+PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createPlugin(
HTMLPlugInElement* element,
const KURL& url,
const Vector<String>& paramNames,
@@ -657,19 +657,27 @@ PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
return nullptr;
// The container takes ownership of the WebPlugin.
- RefPtr<WebPluginContainerImpl> container =
+ RefPtrWillBeRawPtr<WebPluginContainerImpl> container =
WebPluginContainerImpl::create(element, webPlugin);
- if (!webPlugin->initialize(container.get()))
+ if (!webPlugin->initialize(container.get())) {
+#if ENABLE(OILPAN)
+ container->dispose();
+#endif
return nullptr;
+ }
- if (policy != AllowDetachedPlugin && !element->renderer())
+ if (policy != AllowDetachedPlugin && !element->renderer()) {
+#if ENABLE(OILPAN)
+ container->dispose();
+#endif
return nullptr;
+ }
return container;
}
-PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget(
+PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget(
HTMLAppletElement* element,
const KURL& /* baseURL */,
const Vector<String>& paramNames,

Powered by Google App Engine
This is Rietveld 408576698