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

Unified Diff: Source/web/WebPluginContainerImpl.cpp

Issue 715073002: Early return from WebPluginContainerImpl::scriptableObject if the plugin gets destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebPluginContainerImpl.cpp
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index b7936a71f152dedaf94123914bfa4a6813d71e77..321b83fc03259f031267619049db92da780a7a41 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -591,6 +591,12 @@ WebLayer* WebPluginContainerImpl::platformLayer() const
v8::Local<v8::Object> WebPluginContainerImpl::scriptableObject(v8::Isolate* isolate)
{
v8::Local<v8::Object> object = m_webPlugin->v8ScriptableObject(isolate);
+ // |m_webPlugin| may be destroyed during the above line due to re-entrancy
+ // caused by sync messages to the plugin. If this is the case just return an
+ // empty handle. crbug.com/423263.
+ if (!m_webPlugin)
+ return v8::Local<v8::Object>();
+
if (!object.IsEmpty()) {
// WebPlugin implementation can't provide the obsolete NPObject at the same time:
ASSERT(!m_webPlugin->scriptableObject());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698