| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| |
| #include "config.h" |
| #include "V8DataView.h" |
| |
| #include "bindings/core/v8/ExceptionState.h" |
| #include "bindings/core/v8/V8ArrayBuffer.h" |
| #include "bindings/core/v8/V8DOMConfiguration.h" |
| #include "bindings/core/v8/V8HiddenValue.h" |
| #include "bindings/core/v8/V8ObjectConstructor.h" |
| #include "core/dom/ContextFeatures.h" |
| #include "core/dom/Document.h" |
| #include "platform/RuntimeEnabledFeatures.h" |
| #include "platform/TraceEvent.h" |
| #include "wtf/GetPtr.h" |
| #include "wtf/RefPtr.h" |
| |
| namespace blink { |
| |
| const WrapperTypeInfo V8DataView::wrapperTypeInfo = { gin::kEmbedderBlink, 0, V8DataView::refObject, V8DataView::derefObject, V8DataView::trace, 0, 0, 0, V8DataView::installConditionallyEnabledMethods, V8DataView::installConditionallyEnabledProperties, &V8ArrayBufferView::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject }; |
| |
| // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestDataView.h. |
| // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| // bindings/core/v8/ScriptWrappable.h. |
| const WrapperTypeInfo& TestDataView::s_wrapperTypeInfo = V8DataView::wrapperTypeInfo; |
| |
| bool V8DataView::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) |
| { |
| return v8Value->IsDataView(); |
| } |
| |
| TestDataView* V8DataView::toImpl(v8::Handle<v8::Object> object) |
| { |
| ASSERT(object->IsDataView()); |
| ScriptWrappableBase* scriptWrappableBase = blink::toScriptWrappableBase(object); |
| if (scriptWrappableBase) |
| return scriptWrappableBase->toImpl<TestDataView>(); |
| |
| v8::Handle<v8::DataView> v8View = object.As<v8::DataView>(); |
| RefPtr<TestDataView> typedArray = TestDataView::create(V8ArrayBuffer::toImpl(v8View->Buffer()), v8View->ByteOffset(), v8View->ByteLength()); |
| typedArray->associateWithWrapper(typedArray->wrapperTypeInfo(), object, v8::Isolate::GetCurrent()); |
| |
| return typedArray->toImpl<TestDataView>(); |
| } |
| |
| TestDataView* V8DataView::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) |
| { |
| return hasInstance(value, isolate) ? toImpl(v8::Handle<v8::Object>::Cast(value)) : 0; |
| } |
| |
| void V8DataView::refObject(ScriptWrappableBase* scriptWrappableBase) |
| { |
| scriptWrappableBase->toImpl<TestDataView>()->ref(); |
| } |
| |
| void V8DataView::derefObject(ScriptWrappableBase* scriptWrappableBase) |
| { |
| scriptWrappableBase->toImpl<TestDataView>()->deref(); |
| } |
| |
| template<> |
| v8::Handle<v8::Value> toV8NoInline(TestDataView* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| { |
| return toV8(impl, creationContext, isolate); |
| } |
| |
| } // namespace blink |