| 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 "V8SVGTestInterface.h" | |
| 9 | |
| 10 #include "bindings/core/v8/ExceptionState.h" | |
| 11 #include "bindings/core/v8/V8DOMConfiguration.h" | |
| 12 #include "bindings/core/v8/V8HiddenValue.h" | |
| 13 #include "bindings/core/v8/V8ObjectConstructor.h" | |
| 14 #include "core/SVGNames.h" | |
| 15 #include "core/dom/ContextFeatures.h" | |
| 16 #include "core/dom/Document.h" | |
| 17 #include "core/dom/custom/CustomElementProcessingStack.h" | |
| 18 #include "platform/RuntimeEnabledFeatures.h" | |
| 19 #include "platform/TraceEvent.h" | |
| 20 #include "wtf/GetPtr.h" | |
| 21 #include "wtf/RefPtr.h" | |
| 22 | |
| 23 namespace blink { | |
| 24 | |
| 25 const WrapperTypeInfo V8SVGTestInterface::wrapperTypeInfo = { gin::kEmbedderBlin
k, V8SVGTestInterface::domTemplate, V8SVGTestInterface::refObject, V8SVGTestInte
rface::derefObject, V8SVGTestInterface::createPersistentHandle, 0, 0, 0, V8SVGTe
stInterface::installConditionallyEnabledMethods, V8SVGTestInterface::installCond
itionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, Wrap
perTypeInfo::ObjectClassId, WrapperTypeInfo::Dependent, WrapperTypeInfo::RefCoun
tedObject }; | |
| 26 | |
| 27 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in SVGTestInter
face.h. | |
| 28 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | |
| 29 // bindings/core/v8/ScriptWrappable.h. | |
| 30 const WrapperTypeInfo& SVGTestInterface::s_wrapperTypeInfo = V8SVGTestInterface:
:wrapperTypeInfo; | |
| 31 | |
| 32 namespace SVGTestInterfaceV8Internal { | |
| 33 | |
| 34 template <typename T> void V8_USE(T) { } | |
| 35 | |
| 36 static void typeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 37 { | |
| 38 v8::Handle<v8::Object> holder = info.Holder(); | |
| 39 SVGTestInterface* impl = V8SVGTestInterface::toImpl(holder); | |
| 40 v8SetReturnValueString(info, impl->fastGetAttribute(SVGNames::typeAttr), inf
o.GetIsolate()); | |
| 41 } | |
| 42 | |
| 43 static void typeAttributeGetterCallback(v8::Local<v8::String>, const v8::Propert
yCallbackInfo<v8::Value>& info) | |
| 44 { | |
| 45 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
| 46 SVGTestInterfaceV8Internal::typeAttributeGetter(info); | |
| 47 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 48 } | |
| 49 | |
| 50 static void typeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Property
CallbackInfo<void>& info) | |
| 51 { | |
| 52 v8::Handle<v8::Object> holder = info.Holder(); | |
| 53 SVGTestInterface* impl = V8SVGTestInterface::toImpl(holder); | |
| 54 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); | |
| 55 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | |
| 56 impl->setAttribute(SVGNames::typeAttr, cppValue); | |
| 57 } | |
| 58 | |
| 59 static void typeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Val
ue> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
| 60 { | |
| 61 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
| 62 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | |
| 63 SVGTestInterfaceV8Internal::typeAttributeSetter(v8Value, info); | |
| 64 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 65 } | |
| 66 | |
| 67 } // namespace SVGTestInterfaceV8Internal | |
| 68 | |
| 69 static const V8DOMConfiguration::AttributeConfiguration V8SVGTestInterfaceAttrib
utes[] = { | |
| 70 {"type", SVGTestInterfaceV8Internal::typeAttributeGetterCallback, SVGTestInt
erfaceV8Internal::typeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCo
ntrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigur
ation::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | |
| 71 }; | |
| 72 | |
| 73 static void installV8SVGTestInterfaceTemplate(v8::Handle<v8::FunctionTemplate> f
unctionTemplate, v8::Isolate* isolate) | |
| 74 { | |
| 75 functionTemplate->ReadOnlyPrototype(); | |
| 76 | |
| 77 v8::Local<v8::Signature> defaultSignature; | |
| 78 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "SVGTestInterface", v8::Local<v8::FunctionTemplate>(), V8SVGTestInterface::
internalFieldCount, | |
| 79 V8SVGTestInterfaceAttributes, WTF_ARRAY_LENGTH(V8SVGTestInterfaceAttribu
tes), | |
| 80 0, 0, | |
| 81 0, 0, | |
| 82 isolate); | |
| 83 v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTempla
te->InstanceTemplate(); | |
| 84 v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTempl
ate->PrototypeTemplate(); | |
| 85 | |
| 86 // Custom toString template | |
| 87 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | |
| 88 } | |
| 89 | |
| 90 v8::Handle<v8::FunctionTemplate> V8SVGTestInterface::domTemplate(v8::Isolate* is
olate) | |
| 91 { | |
| 92 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8SVGTestInterfaceTemplate); | |
| 93 } | |
| 94 | |
| 95 bool V8SVGTestInterface::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate*
isolate) | |
| 96 { | |
| 97 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | |
| 98 } | |
| 99 | |
| 100 v8::Handle<v8::Object> V8SVGTestInterface::findInstanceInPrototypeChain(v8::Hand
le<v8::Value> v8Value, v8::Isolate* isolate) | |
| 101 { | |
| 102 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | |
| 103 } | |
| 104 | |
| 105 SVGTestInterface* V8SVGTestInterface::toImplWithTypeCheck(v8::Isolate* isolate,
v8::Handle<v8::Value> value) | |
| 106 { | |
| 107 return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle
<v8::Object>::Cast(value))->toImpl<SVGTestInterface>() : 0; | |
| 108 } | |
| 109 | |
| 110 | |
| 111 void V8SVGTestInterface::refObject(ScriptWrappableBase* internalPointer) | |
| 112 { | |
| 113 internalPointer->toImpl<SVGTestInterface>()->ref(); | |
| 114 } | |
| 115 | |
| 116 void V8SVGTestInterface::derefObject(ScriptWrappableBase* internalPointer) | |
| 117 { | |
| 118 internalPointer->toImpl<SVGTestInterface>()->deref(); | |
| 119 } | |
| 120 | |
| 121 WrapperPersistentNode* V8SVGTestInterface::createPersistentHandle(ScriptWrappabl
eBase* internalPointer) | |
| 122 { | |
| 123 ASSERT_NOT_REACHED(); | |
| 124 return 0; | |
| 125 } | |
| 126 | |
| 127 template<> | |
| 128 v8::Handle<v8::Value> toV8NoInline(SVGTestInterface* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) | |
| 129 { | |
| 130 return toV8(impl, creationContext, isolate); | |
| 131 } | |
| 132 | |
| 133 } // namespace blink | |
| OLD | NEW |