return TypedArrayTraits<TypedArray>::IsInstance(value);
}
- static TypedArray* toNative(v8::Handle<v8::Object>);
- static TypedArray* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
+ static TypedArray* toImpl(v8::Handle<v8::Object>);
+ static TypedArray* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
+ static void refObject(ScriptWrappableBase* internalPointer);
static void derefObject(ScriptWrappableBase* internalPointer);
+ static WrapperPersistentNode* createPersistentHandle(ScriptWrappableBase* internalPointer);
static const WrapperTypeInfo wrapperTypeInfo;
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount;
info.GetReturnValue().Set(wrapper);
}
- static inline ScriptWrappableBase* toInternalPointer(TypedArray* impl)
+ static inline ScriptWrappableBase* toScriptWrappableBase(TypedArray* impl)
{
return reinterpret_cast<ScriptWrappableBase*>(static_cast<void*>(impl));
}
- static inline TypedArray* fromInternalPointer(ScriptWrappableBase* internalPointer)
+ static inline TypedArray* toImpl(ScriptWrappableBase* internalPointer)
{
return reinterpret_cast<TypedArray*>(static_cast<void*>(internalPointer));
}
v8::Local<v8::Object> wrapper = V8Type::New(v8Buffer.As<v8::ArrayBuffer>(), impl->byteOffset(), Traits::length(impl.get()));
- V8DOMWrapper::associateObjectWithWrapper<Binding>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
+ V8DOMWrapper::associateObjectWithWrapper<Binding>(impl, &wrapperTypeInfo, wrapper, isolate);
return wrapper;
}
template <typename TypedArray>
-TypedArray* V8TypedArray<TypedArray>::toNative(v8::Handle<v8::Object> object)
+TypedArray* V8TypedArray<TypedArray>::toImpl(v8::Handle<v8::Object> object)
{
ASSERT(Traits::IsInstance(object));
void* typedarrayPtr = object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex);
return reinterpret_cast<TypedArray*>(typedarrayPtr);
v8::Handle<V8Type> view = object.As<V8Type>();
- RefPtr<ArrayBuffer> arrayBuffer = V8ArrayBuffer::toNative(view->Buffer());
+ RefPtr<ArrayBuffer> arrayBuffer = V8ArrayBuffer::toImpl(view->Buffer());
RefPtr<TypedArray> typedArray = TypedArray::create(arrayBuffer, view->ByteOffset(), Traits::length(view));
ASSERT(typedArray.get());
- V8DOMWrapper::associateObjectWithWrapper<Binding>(typedArray.release(), &wrapperTypeInfo, object, v8::Isolate::GetCurrent(), WrapperConfiguration::Independent);
+ V8DOMWrapper::associateObjectWithWrapper<Binding>(typedArray.release(), &wrapperTypeInfo, object, v8::Isolate::GetCurrent());
typedarrayPtr = object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex);
ASSERT(typedarrayPtr);
}
template <typename TypedArray>
-TypedArray* V8TypedArray<TypedArray>::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
+TypedArray* V8TypedArray<TypedArray>::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
{
- return V8TypedArray<TypedArray>::hasInstance(value, isolate) ? V8TypedArray<TypedArray>::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
+ return V8TypedArray<TypedArray>::hasInstance(value, isolate) ? V8TypedArray<TypedArray>::toImpl(v8::Handle<v8::Object>::Cast(value)) : 0;
}
template <typename TypedArray>
const WrapperTypeInfo V8TypedArray<TypedArray>::wrapperTypeInfo = {
gin::kEmbedderBlink,
- 0, V8TypedArray<TypedArray>::derefObject,
- 0, 0, 0, 0, 0, WrapperTypeObjectPrototype, RefCountedObject
+ 0,
+ V8TypedArray<TypedArray>::refObject,
+ V8TypedArray<TypedArray>::derefObject,
+ V8TypedArray<TypedArray>::createPersistentHandle,
+ 0, 0, 0, 0, 0, 0,
+ WrapperTypeInfo::WrapperTypeObjectPrototype,
+ WrapperTypeInfo::ObjectClassId,
+ WrapperTypeInfo::Independent,
+ WrapperTypeInfo::RefCountedObject
};
template <typename TypedArray>
+void V8TypedArray<TypedArray>::refObject(ScriptWrappableBase* internalPointer)
+{
+ toImpl(internalPointer)->ref();
+}
+
+template <typename TypedArray>
void V8TypedArray<TypedArray>::derefObject(ScriptWrappableBase* internalPointer)
{
- fromInternalPointer(internalPointer)->deref();
+ toImpl(internalPointer)->deref();
}
+template <typename TypedArray>
+WrapperPersistentNode* V8TypedArray<TypedArray>::createPersistentHandle(ScriptWrappableBase* internalPointer)
+{
+ ASSERT_NOT_REACHED();
+ return 0;
+}
-} // namespace WebCode
+} // namespace blink
#endif // V8TypedArrayCustom_h