Chromium Code Reviews| Index: Source/bindings/v8/V8NPObject.cpp |
| diff --git a/Source/bindings/v8/V8NPObject.cpp b/Source/bindings/v8/V8NPObject.cpp |
| index a3f8ab7566c8219ff8ac88292599c05ee6b53164..f9b7e8d57c917bc3c236e3a5efe050088eec6b60 100644 |
| --- a/Source/bindings/v8/V8NPObject.cpp |
| +++ b/Source/bindings/v8/V8NPObject.cpp |
| @@ -36,7 +36,6 @@ |
| #include "V8HTMLEmbedElement.h" |
| #include "V8HTMLObjectElement.h" |
| #include "bindings/v8/NPV8Object.h" |
| -#include "bindings/v8/UnsafePersistent.h" |
| #include "bindings/v8/V8Binding.h" |
| #include "bindings/v8/V8NPUtils.h" |
| #include "bindings/v8/V8ObjectConstructor.h" |
| @@ -404,22 +403,18 @@ static DOMWrapperMap<NPObject>& staticNPObjectMap() |
| return npObjectMap; |
| } |
| -template<> |
| -inline void DOMWrapperMap<NPObject>::setWeakCallback(const v8::WeakCallbackData<v8::Object, DOMWrapperMap<NPObject> >& data) |
| +template <> |
| +inline void DOMWrapperMap<NPObject>::PersistentValueMapTraits::Dispose( |
| + v8::UniquePersistent<v8::Object> value, |
| + v8::Isolate* isolate, |
| + DOMWrapperMap<NPObject>::PersistentValueMapTraits::Impl* impl, |
| + NPObject* key) |
| { |
| - NPObject* npObject = static_cast<NPObject*>(toNative(data.GetValue())); |
| - |
| - ASSERT(npObject); |
| - ASSERT(staticNPObjectMap().containsKeyAndValue(npObject, data.GetValue())); |
|
dcarney
2014/03/11 15:16:28
can we keep the assert?
vogelheim
2014/03/11 18:35:31
Done.
vogelheim
2014/03/20 18:19:05
And gone again. :)
This caused test crashes, sinc
|
| - |
| - // Must remove from our map before calling _NPN_ReleaseObject(). _NPN_ReleaseObject can |
| - // call forgetV8ObjectForNPObject, which uses the table as well. |
| - staticNPObjectMap().removeAndDispose(npObject); |
| - |
| - if (_NPN_IsAlive(npObject)) |
| - _NPN_ReleaseObject(npObject); |
| + if (_NPN_IsAlive(key)) |
| + _NPN_ReleaseObject(key); |
| } |
| + |
| v8::Local<v8::Object> createV8ObjectForNPObject(NPObject* object, NPObject* root, v8::Isolate* isolate) |
| { |
| static v8::Eternal<v8::FunctionTemplate> npObjectDesc; |