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

Unified Diff: Source/WebCore/bindings/v8/V8NPObject.cpp

Issue 10388233: Merge 117012 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « Source/WebCore/bindings/v8/NPV8Object.cpp ('k') | Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/v8/V8NPObject.cpp
===================================================================
--- Source/WebCore/bindings/v8/V8NPObject.cpp (revision 118022)
+++ Source/WebCore/bindings/v8/V8NPObject.cpp (working copy)
@@ -139,7 +139,9 @@
_NPN_ReleaseVariantValue(&npArgs[i]);
// Unwrap return values.
- v8::Handle<v8::Value> returnValue = convertNPVariantToV8Object(&result, npObject);
+ v8::Handle<v8::Value> returnValue;
+ if (_NPN_IsAlive(npObject))
+ returnValue = convertNPVariantToV8Object(&result, npObject);
_NPN_ReleaseVariantValue(&result);
return returnValue;
@@ -191,21 +193,30 @@
return throwError("NPObject deleted", V8Proxy::ReferenceError);
- if (npObject->_class->hasProperty && npObject->_class->hasProperty(npObject, identifier)
- && npObject->_class->getProperty) {
+ if (npObject->_class->hasProperty && npObject->_class->getProperty && npObject->_class->hasProperty(npObject, identifier)) {
+ if (!_NPN_IsAlive(npObject))
+ return throwError("NPObject deleted", V8Proxy::ReferenceError);
NPVariant result;
VOID_TO_NPVARIANT(result);
if (!npObject->_class->getProperty(npObject, identifier, &result))
return v8::Handle<v8::Value>();
- v8::Handle<v8::Value> returnValue = convertNPVariantToV8Object(&result, npObject);
+ v8::Handle<v8::Value> returnValue;
+ if (_NPN_IsAlive(npObject))
+ returnValue = convertNPVariantToV8Object(&result, npObject);
_NPN_ReleaseVariantValue(&result);
return returnValue;
}
+ if (!_NPN_IsAlive(npObject))
+ return throwError("NPObject deleted", V8Proxy::ReferenceError);
+
if (key->IsString() && npObject->_class->hasMethod && npObject->_class->hasMethod(npObject, identifier)) {
+ if (!_NPN_IsAlive(npObject))
+ return throwError("NPObject deleted", V8Proxy::ReferenceError);
+
PrivateIdentifier* id = static_cast<PrivateIdentifier*>(identifier);
v8::Persistent<v8::FunctionTemplate> functionTemplate = staticTemplateMap().get(id);
// Cache templates using identifier as the key.
@@ -266,8 +277,9 @@
return value; // Intercepted, but an exception was thrown.
}
- if (npObject->_class->hasProperty && npObject->_class->hasProperty(npObject, identifier)
- && npObject->_class->setProperty) {
+ if (npObject->_class->hasProperty && npObject->_class->setProperty && npObject->_class->hasProperty(npObject, identifier)) {
+ if (!_NPN_IsAlive(npObject))
+ return throwError("NPObject deleted", V8Proxy::ReferenceError);
NPVariant npValue;
VOID_TO_NPVARIANT(npValue);
« no previous file with comments | « Source/WebCore/bindings/v8/NPV8Object.cpp ('k') | Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698