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

Unified Diff: Source/core/html/HTMLPlugInImageElement.cpp

Issue 23618022: BrowserPlugin/WebView - Move plugin lifetime to DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleaned up. Created 7 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/core/html/HTMLPlugInImageElement.cpp
diff --git a/Source/core/html/HTMLPlugInImageElement.cpp b/Source/core/html/HTMLPlugInImageElement.cpp
index 5b20828da872b4977fbcd139f4e7aa4c84fcb9ef..28bbff3f2e6ef34297f35cc369c2486dadc0c1b1 100644
--- a/Source/core/html/HTMLPlugInImageElement.cpp
+++ b/Source/core/html/HTMLPlugInImageElement.cpp
@@ -259,8 +259,12 @@ bool HTMLPlugInImageElement::loadPlugin(const KURL& url, const String& mimeType,
m_loadedUrl = url;
IntSize contentSize = roundedIntSize(LayoutSize(renderer->contentWidth(), renderer->contentHeight()));
- bool loadManually = document().isPluginDocument() && !frame->loader()->containsPlugins() && toPluginDocument(document()).shouldLoadPluginManually();
- RefPtr<Widget> widget = frame->loader()->client()->createPlugin(contentSize, this, url, paramNames, paramValues, mimeType, loadManually);
+ RefPtr<Widget> widget = plugin();
+
+ if (!widget) {
+ bool loadManually = document().isPluginDocument() && !frame->loader()->containsPlugins() && toPluginDocument(document()).shouldLoadPluginManually();
+ widget = frame->loader()->client()->createPlugin(contentSize, this, url, paramNames, paramValues, mimeType, loadManually);
+ }
if (!widget) {
if (!renderer->showsUnavailablePluginIndicator())
@@ -269,6 +273,8 @@ bool HTMLPlugInImageElement::loadPlugin(const KURL& url, const String& mimeType,
}
renderer->setWidget(widget);
+ if (widget->isPluginContainer() && widget->pluginShouldPersist())
+ setPlugin(widget);
frame->loader()->setContainsPlugins();
setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer);
return true;

Powered by Google App Engine
This is Rietveld 408576698