OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 |
| 7 #include "config.h" |
| 8 #include "V8ArrayBufferView.h" |
| 9 |
| 10 #include "bindings/core/v8/ExceptionState.h" |
| 11 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 12 #include "bindings/core/v8/V8DOMConfiguration.h" |
| 13 #include "bindings/core/v8/V8DataView.h" |
| 14 #include "bindings/core/v8/V8Float32Array.h" |
| 15 #include "bindings/core/v8/V8Float64Array.h" |
| 16 #include "bindings/core/v8/V8HiddenValue.h" |
| 17 #include "bindings/core/v8/V8Int16Array.h" |
| 18 #include "bindings/core/v8/V8Int32Array.h" |
| 19 #include "bindings/core/v8/V8Int8Array.h" |
| 20 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 21 #include "bindings/core/v8/V8Uint16Array.h" |
| 22 #include "bindings/core/v8/V8Uint32Array.h" |
| 23 #include "bindings/core/v8/V8Uint8Array.h" |
| 24 #include "bindings/core/v8/V8Uint8ClampedArray.h" |
| 25 #include "core/dom/ContextFeatures.h" |
| 26 #include "core/dom/Document.h" |
| 27 #include "platform/RuntimeEnabledFeatures.h" |
| 28 #include "platform/TraceEvent.h" |
| 29 #include "wtf/GetPtr.h" |
| 30 #include "wtf/RefPtr.h" |
| 31 |
| 32 namespace blink { |
| 33 |
| 34 const WrapperTypeInfo V8ArrayBufferView::wrapperTypeInfo = { gin::kEmbedderBlink
, 0, V8ArrayBufferView::refObject, V8ArrayBufferView::derefObject, V8ArrayBuffer
View::trace, 0, 0, 0, V8ArrayBufferView::installConditionallyEnabledMethods, V8A
rrayBufferView::installConditionallyEnabledProperties, 0, WrapperTypeInfo::Wrapp
erTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Independ
ent, WrapperTypeInfo::RefCountedObject }; |
| 35 |
| 36 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestArrayBuf
ferView.h. |
| 37 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| 38 // bindings/core/v8/ScriptWrappable.h. |
| 39 const WrapperTypeInfo& TestArrayBufferView::s_wrapperTypeInfo = V8ArrayBufferVie
w::wrapperTypeInfo; |
| 40 |
| 41 bool V8ArrayBufferView::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate*
isolate) |
| 42 { |
| 43 return v8Value->IsArrayBufferView(); |
| 44 } |
| 45 |
| 46 TestArrayBufferView* V8ArrayBufferView::toImpl(v8::Handle<v8::Object> object) |
| 47 { |
| 48 ASSERT(object->IsArrayBufferView()); |
| 49 ScriptWrappableBase* internalPointer = blink::toScriptWrappableBase(object); |
| 50 if (internalPointer) |
| 51 return internalPointer->toImpl<TestArrayBufferView>(); |
| 52 |
| 53 if (object->IsInt8Array()) |
| 54 return V8Int8Array::toImpl(object); |
| 55 if (object->IsInt16Array()) |
| 56 return V8Int16Array::toImpl(object); |
| 57 if (object->IsInt32Array()) |
| 58 return V8Int32Array::toImpl(object); |
| 59 if (object->IsUint8Array()) |
| 60 return V8Uint8Array::toImpl(object); |
| 61 if (object->IsUint8ClampedArray()) |
| 62 return V8Uint8ClampedArray::toImpl(object); |
| 63 if (object->IsUint16Array()) |
| 64 return V8Uint16Array::toImpl(object); |
| 65 if (object->IsUint32Array()) |
| 66 return V8Uint32Array::toImpl(object); |
| 67 if (object->IsFloat32Array()) |
| 68 return V8Float32Array::toImpl(object); |
| 69 if (object->IsFloat64Array()) |
| 70 return V8Float64Array::toImpl(object); |
| 71 if (object->IsDataView()) |
| 72 return V8DataView::toImpl(object); |
| 73 |
| 74 ASSERT_NOT_REACHED(); |
| 75 return 0; |
| 76 } |
| 77 |
| 78 TestArrayBufferView* V8ArrayBufferView::toImplWithTypeCheck(v8::Isolate* isolate
, v8::Handle<v8::Value> value) |
| 79 { |
| 80 return hasInstance(value, isolate) ? toImpl(v8::Handle<v8::Object>::Cast(val
ue)) : 0; |
| 81 } |
| 82 |
| 83 void V8ArrayBufferView::refObject(ScriptWrappableBase* internalPointer) |
| 84 { |
| 85 internalPointer->toImpl<TestArrayBufferView>()->ref(); |
| 86 } |
| 87 |
| 88 void V8ArrayBufferView::derefObject(ScriptWrappableBase* internalPointer) |
| 89 { |
| 90 internalPointer->toImpl<TestArrayBufferView>()->deref(); |
| 91 } |
| 92 |
| 93 template<> |
| 94 v8::Handle<v8::Value> toV8NoInline(TestArrayBufferView* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) |
| 95 { |
| 96 return toV8(impl, creationContext, isolate); |
| 97 } |
| 98 |
| 99 } // namespace blink |
OLD | NEW |