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

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

Issue 23766014: remove static persistent in V8NPObject.cpp (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8NPObject.cpp
diff --git a/Source/bindings/v8/V8NPObject.cpp b/Source/bindings/v8/V8NPObject.cpp
index 73ccff14bcccb60924a3426566552fb73ad718f6..e5aaf6e480f6d582aa50523dd5fa38d89180ee58 100644
--- a/Source/bindings/v8/V8NPObject.cpp
+++ b/Source/bindings/v8/V8NPObject.cpp
@@ -417,7 +417,7 @@ inline void DOMWrapperMap<NPObject>::makeWeakCallback(v8::Isolate* isolate, v8::
v8::Local<v8::Object> createV8ObjectForNPObject(NPObject* object, NPObject* root)
{
- static v8::Persistent<v8::FunctionTemplate> npObjectDesc;
+ static v8::Eternal<v8::FunctionTemplate> npObjectDesc;
ASSERT(v8::Context::InContext());
@@ -437,19 +437,19 @@ v8::Local<v8::Object> createV8ObjectForNPObject(NPObject* object, NPObject* root
// pointer, and field 1 is the type. There should be an api function that returns unused type id. The same Wrapper type
// can be used by DOM bindings.
if (npObjectDesc.IsEmpty()) {
- v8::Handle<v8::FunctionTemplate> templ = v8::FunctionTemplate::New();
+ v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New();
templ->InstanceTemplate()->SetInternalFieldCount(npObjectInternalFieldCount);
templ->InstanceTemplate()->SetNamedPropertyHandler(npObjectNamedPropertyGetter, npObjectNamedPropertySetter, npObjectQueryProperty, 0, npObjectNamedPropertyEnumerator);
templ->InstanceTemplate()->SetIndexedPropertyHandler(npObjectIndexedPropertyGetter, npObjectIndexedPropertySetter, 0, 0, npObjectIndexedPropertyEnumerator);
templ->InstanceTemplate()->SetCallAsFunctionHandler(npObjectInvokeDefaultHandler);
- npObjectDesc.Reset(isolate, templ);
+ npObjectDesc.Set(isolate, templ);
}
// FIXME: Move staticNPObjectMap() to DOMDataStore.
// Use V8DOMWrapper::createWrapper() and
// V8DOMWrapper::associateObjectWithWrapper()
// to create a wrapper object.
- v8::Handle<v8::Function> v8Function = v8::Local<v8::FunctionTemplate>::New(isolate, npObjectDesc)->GetFunction();
+ v8::Handle<v8::Function> v8Function = npObjectDesc.Get(isolate)->GetFunction();
v8::Local<v8::Object> value = V8ObjectConstructor::newInstance(v8Function);
if (value.IsEmpty())
return value;
« 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