| 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 "V8TestInterfaceNotScriptWrappable.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 "bindings/core/v8/V8TestInterfaceNotScriptWrappable.h" | |
| 15 #include "core/dom/ContextFeatures.h" | |
| 16 #include "core/dom/Document.h" | |
| 17 #include "platform/RuntimeEnabledFeatures.h" | |
| 18 #include "platform/TraceEvent.h" | |
| 19 #include "wtf/GetPtr.h" | |
| 20 #include "wtf/RefPtr.h" | |
| 21 | |
| 22 namespace blink { | |
| 23 | |
| 24 const WrapperTypeInfo V8TestInterfaceNotScriptWrappable::wrapperTypeInfo = { gin
::kEmbedderBlink, V8TestInterfaceNotScriptWrappable::domTemplate, V8TestInterfac
eNotScriptWrappable::refObject, V8TestInterfaceNotScriptWrappable::derefObject,
V8TestInterfaceNotScriptWrappable::trace, 0, 0, 0, V8TestInterfaceNotScriptWrapp
able::installConditionallyEnabledMethods, V8TestInterfaceNotScriptWrappable::ins
tallConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototy
pe, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Independent, WrapperTypeInf
o::RefCountedObject }; | |
| 25 | |
| 26 namespace TestInterfaceNotScriptWrappableV8Internal { | |
| 27 | |
| 28 static void attr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info
) | |
| 29 { | |
| 30 v8::Handle<v8::Object> holder = info.Holder(); | |
| 31 TestInterfaceNotScriptWrappable* impl = V8TestInterfaceNotScriptWrappable::t
oImpl(holder); | |
| 32 v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl); | |
| 33 } | |
| 34 | |
| 35 static void attr1AttributeGetterCallback(v8::Local<v8::String>, const v8::Proper
tyCallbackInfo<v8::Value>& info) | |
| 36 { | |
| 37 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
| 38 TestInterfaceNotScriptWrappableV8Internal::attr1AttributeGetter(info); | |
| 39 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 40 } | |
| 41 | |
| 42 static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Propert
yCallbackInfo<void>& info) | |
| 43 { | |
| 44 v8::Handle<v8::Object> holder = info.Holder(); | |
| 45 TestInterfaceNotScriptWrappable* impl = V8TestInterfaceNotScriptWrappable::t
oImpl(holder); | |
| 46 TestInterfaceNotScriptWrappable* cppValue = V8TestInterfaceNotScriptWrappabl
e::toImplWithTypeCheck(info.GetIsolate(), v8Value); | |
| 47 impl->setAttr1(WTF::getPtr(cppValue)); | |
| 48 } | |
| 49 | |
| 50 static void attr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Va
lue> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
| 51 { | |
| 52 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
| 53 TestInterfaceNotScriptWrappableV8Internal::attr1AttributeSetter(v8Value, inf
o); | |
| 54 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 55 } | |
| 56 | |
| 57 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | |
| 58 { | |
| 59 if (UNLIKELY(info.Length() < 1)) { | |
| 60 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in
fo.GetIsolate(), "func", "TestInterfaceNotScriptWrappable", 1, info.Length()), i
nfo.GetIsolate()); | |
| 61 return; | |
| 62 } | |
| 63 TestInterfaceNotScriptWrappable* impl = V8TestInterfaceNotScriptWrappable::t
oImpl(info.Holder()); | |
| 64 TestInterfaceNotScriptWrappable* arg; | |
| 65 { | |
| 66 arg = V8TestInterfaceNotScriptWrappable::toImplWithTypeCheck(info.GetIso
late(), info[0]); | |
| 67 } | |
| 68 impl->func(arg); | |
| 69 } | |
| 70 | |
| 71 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | |
| 72 { | |
| 73 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | |
| 74 TestInterfaceNotScriptWrappableV8Internal::funcMethod(info); | |
| 75 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 76 } | |
| 77 | |
| 78 } // namespace TestInterfaceNotScriptWrappableV8Internal | |
| 79 | |
| 80 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNotScript
WrappableAttributes[] = { | |
| 81 {"attr1", TestInterfaceNotScriptWrappableV8Internal::attr1AttributeGetterCal
lback, TestInterfaceNotScriptWrappableV8Internal::attr1AttributeSetterCallback,
0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAt
tribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration:
:OnInstance}, | |
| 82 }; | |
| 83 | |
| 84 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceNotScriptWra
ppableMethods[] = { | |
| 85 {"func", TestInterfaceNotScriptWrappableV8Internal::funcMethodCallback, 0, 1
, V8DOMConfiguration::ExposedToAllScripts}, | |
| 86 }; | |
| 87 | |
| 88 static void installV8TestInterfaceNotScriptWrappableTemplate(v8::Handle<v8::Func
tionTemplate> functionTemplate, v8::Isolate* isolate) | |
| 89 { | |
| 90 functionTemplate->ReadOnlyPrototype(); | |
| 91 | |
| 92 v8::Local<v8::Signature> defaultSignature; | |
| 93 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceNotScriptWrappable", v8::Local<v8::FunctionTemplate>(), V8Tes
tInterfaceNotScriptWrappable::internalFieldCount, | |
| 94 V8TestInterfaceNotScriptWrappableAttributes, WTF_ARRAY_LENGTH(V8TestInte
rfaceNotScriptWrappableAttributes), | |
| 95 0, 0, | |
| 96 V8TestInterfaceNotScriptWrappableMethods, WTF_ARRAY_LENGTH(V8TestInterfa
ceNotScriptWrappableMethods), | |
| 97 isolate); | |
| 98 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | |
| 99 ALLOW_UNUSED_LOCAL(instanceTemplate); | |
| 100 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
| 101 ALLOW_UNUSED_LOCAL(prototypeTemplate); | |
| 102 | |
| 103 // Custom toString template | |
| 104 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | |
| 105 } | |
| 106 | |
| 107 v8::Handle<v8::FunctionTemplate> V8TestInterfaceNotScriptWrappable::domTemplate(
v8::Isolate* isolate) | |
| 108 { | |
| 109 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterfaceNotScriptWrappableTemplate); | |
| 110 } | |
| 111 | |
| 112 bool V8TestInterfaceNotScriptWrappable::hasInstance(v8::Handle<v8::Value> v8Valu
e, v8::Isolate* isolate) | |
| 113 { | |
| 114 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | |
| 115 } | |
| 116 | |
| 117 v8::Handle<v8::Object> V8TestInterfaceNotScriptWrappable::findInstanceInPrototyp
eChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) | |
| 118 { | |
| 119 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | |
| 120 } | |
| 121 | |
| 122 TestInterfaceNotScriptWrappable* V8TestInterfaceNotScriptWrappable::toImplWithTy
peCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) | |
| 123 { | |
| 124 return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle
<v8::Object>::Cast(value))->toImpl<TestInterfaceNotScriptWrappable>() : 0; | |
| 125 } | |
| 126 | |
| 127 void V8TestInterfaceNotScriptWrappable::refObject(ScriptWrappableBase* scriptWra
ppableBase) | |
| 128 { | |
| 129 scriptWrappableBase->toImpl<TestInterfaceNotScriptWrappable>()->ref(); | |
| 130 } | |
| 131 | |
| 132 void V8TestInterfaceNotScriptWrappable::derefObject(ScriptWrappableBase* scriptW
rappableBase) | |
| 133 { | |
| 134 scriptWrappableBase->toImpl<TestInterfaceNotScriptWrappable>()->deref(); | |
| 135 } | |
| 136 | |
| 137 template<> | |
| 138 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNotScriptWrappable* impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) | |
| 139 { | |
| 140 return toV8(impl, creationContext, isolate); | |
| 141 } | |
| 142 | |
| 143 } // namespace blink | |
| OLD | NEW |