This source file includes following definitions.
- toNative
- toNativeWithTypeCheck
#include "config.h"
#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
#include "bindings/v8/custom/V8DataViewCustom.h"
#include "bindings/v8/custom/V8Float32ArrayCustom.h"
#include "bindings/v8/custom/V8Float64ArrayCustom.h"
#include "bindings/v8/custom/V8Int16ArrayCustom.h"
#include "bindings/v8/custom/V8Int32ArrayCustom.h"
#include "bindings/v8/custom/V8Int8ArrayCustom.h"
#include "bindings/v8/custom/V8Uint16ArrayCustom.h"
#include "bindings/v8/custom/V8Uint32ArrayCustom.h"
#include "bindings/v8/custom/V8Uint8ArrayCustom.h"
#include "bindings/v8/custom/V8Uint8ClampedArrayCustom.h"
#include <v8.h>
namespace WebCore {
using namespace WTF;
ArrayBufferView* V8ArrayBufferView::toNative(v8::Handle<v8::Object> object)
{
ASSERT(object->IsArrayBufferView());
void* viewPtr = object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex);
if (viewPtr)
return reinterpret_cast<ArrayBufferView*>(viewPtr);
if (object->IsUint8Array()) {
return V8Uint8Array::toNative(object);
}
if (object->IsInt8Array()) {
return V8Int8Array::toNative(object);
}
if (object->IsUint16Array()) {
return V8Uint16Array::toNative(object);
}
if (object->IsInt16Array()) {
return V8Int16Array::toNative(object);
}
if (object->IsUint32Array()) {
return V8Uint32Array::toNative(object);
}
if (object->IsInt32Array()) {
return V8Int32Array::toNative(object);
}
if (object->IsFloat32Array()) {
return V8Float32Array::toNative(object);
}
if (object->IsFloat64Array()) {
return V8Float64Array::toNative(object);
}
if (object->IsUint8ClampedArray()) {
return V8Uint8ClampedArray::toNative(object);
}
if (object->IsDataView()) {
return V8DataView::toNative(object);
}
ASSERT_NOT_REACHED();
return 0;
}
ArrayBufferView* V8ArrayBufferView::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
{
return V8ArrayBufferView::hasInstance(value, isolate) ? V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
}
}