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

Unified Diff: Source/web/WebPluginContainerImpl.cpp

Issue 1326603002: Oilpan: update plugin handling to work over plugins persisted over reattach (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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/WebPluginContainerImpl.cpp
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index 8ec7ca5205cc8375c766985d4722f1946bcfa66f..bcf8d5e7665462d75d94c1b76d97423a4c118888 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -606,6 +606,15 @@ WebLayer* WebPluginContainerImpl::platformLayer() const
v8::Local<v8::Object> WebPluginContainerImpl::scriptableObject(v8::Isolate* isolate)
{
+#if ENABLE(OILPAN)
+ // With Oilpan, on plugin element detach dispose() will be called to safely
+ // clear out references, including the pre-emptive destruction of the plugin.
+ //
+ // It clearly has no scriptable object if in such a disposed state.
+ if (!m_webPlugin)
+ return v8::Local<v8::Object>();
+#endif
+
// The plugin may be destroyed due to re-entrancy when calling
// v8ScriptableObject below. crbug.com/458776. Hold a reference to the
// plugin container to prevent this from happening. For Oilpan, 'this'
« Source/core/html/HTMLPlugInElement.cpp ('K') | « Source/core/html/HTMLPlugInElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698