#ifndef V8DataViewCustom_h
#define V8DataViewCustom_h
#include "bindings/v8/custom/V8TypedArrayCustom.h"
#include "core/html/canvas/DataView.h"
namespace WebCore {
template<>
class TypedArrayTraits<DataView> {
public:
typedef v8::DataView V8Type;
static bool IsInstance(v8::Handle<v8::Value> value)
{
return value->IsDataView();
}
static size_t length(v8::Handle<v8::DataView> value)
{
return value->ByteLength();
}
static size_t length(DataView* array)
{
return array->byteLength();
}
};
typedef V8TypedArray<DataView> V8DataView;
inline v8::Handle<v8::Object> wrap(DataView* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
return V8TypedArray<DataView>::wrap(impl, creationContext, isolate);
}
inline v8::Handle<v8::Value> toV8(DataView* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
return V8TypedArray<DataView>::toV8(impl, creationContext, isolate);
}
template<class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& info, DataView* impl)
{
V8TypedArray<DataView>::v8SetReturnValue(info, impl);
}
template<class CallbackInfo>
inline void v8SetReturnValueForMainWorld(const CallbackInfo& info, DataView* impl)
{
V8TypedArray<DataView>::v8SetReturnValueForMainWorld(info, impl);
}
template<class CallbackInfo, class Wrappable>
inline void v8SetReturnValueFast(const CallbackInfo& info, DataView* impl, Wrappable* wrappable)
{
V8TypedArray<DataView>::v8SetReturnValueFast(info, impl, wrappable);
}
inline v8::Handle<v8::Value> toV8(PassRefPtr< DataView > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
return toV8(impl.get(), creationContext, isolate);
}
template<class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& info, PassRefPtr<DataView> impl)
{
v8SetReturnValue(info, impl.get());
}
template<class CallbackInfo>
inline void v8SetReturnValueForMainWorld(const CallbackInfo& info, PassRefPtr<DataView> impl)
{
v8SetReturnValueForMainWorld(info, impl.get());
}
template<class CallbackInfo, class Wrappable>
inline void v8SetReturnValueFast(const CallbackInfo& info, PassRefPtr<DataView> impl, Wrappable* wrappable)
{
v8SetReturnValueFast(info, impl.get(), wrappable);
}
}
#endif