OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by code_generator_v8.py. | 5 // This file has been auto-generated by code_generator_v8.py. |
6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
7 | 7 |
8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl | 9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 TestSubObjectV8Internal::unforgeableLongAttributeAttributeSetter(v8Value, info
); | 139 TestSubObjectV8Internal::unforgeableLongAttributeAttributeSetter(v8Value, info
); |
140 } | 140 } |
141 | 141 |
142 static const V8DOMConfiguration::AccessorConfiguration V8TestSubObjectAccessors[
] = { | 142 static const V8DOMConfiguration::AccessorConfiguration V8TestSubObjectAccessors[
] = { |
143 { "unforgeableStringAttribute", V8TestSubObject::unforgeableStringAttributeA
ttributeGetterCallback, V8TestSubObject::unforgeableStringAttributeAttributeSett
erCallback, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::DontDelete)
, V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfig
uration::kAllWorlds }, | 143 { "unforgeableStringAttribute", V8TestSubObject::unforgeableStringAttributeA
ttributeGetterCallback, V8TestSubObject::unforgeableStringAttributeAttributeSett
erCallback, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::DontDelete)
, V8DOMConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfig
uration::kAllWorlds }, |
144 | 144 |
145 { "unforgeableLongAttribute", V8TestSubObject::unforgeableLongAttributeAttri
buteGetterCallback, V8TestSubObject::unforgeableLongAttributeAttributeSetterCall
back, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DO
MConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguratio
n::kAllWorlds }, | 145 { "unforgeableLongAttribute", V8TestSubObject::unforgeableLongAttributeAttri
buteGetterCallback, V8TestSubObject::unforgeableLongAttributeAttributeSetterCall
back, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DO
MConfiguration::kOnInstance, V8DOMConfiguration::kCheckHolder, V8DOMConfiguratio
n::kAllWorlds }, |
146 }; | 146 }; |
147 | 147 |
148 static void installV8TestSubObjectTemplate(v8::Isolate* isolate, const DOMWrappe
rWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) { | 148 static void installV8TestSubObjectTemplate( |
| 149 v8::Isolate* isolate, |
| 150 const DOMWrapperWorld& world, |
| 151 v8::Local<v8::FunctionTemplate> interfaceTemplate) { |
149 // Initialize the interface object's template. | 152 // Initialize the interface object's template. |
150 V8DOMConfiguration::InitializeDOMInterfaceTemplate(isolate, interfaceTemplate,
V8TestSubObject::wrapperTypeInfo.interface_name, V8TestObject::domTemplate(isol
ate, world), V8TestSubObject::internalFieldCount); | 153 V8DOMConfiguration::InitializeDOMInterfaceTemplate(isolate, interfaceTemplate,
V8TestSubObject::wrapperTypeInfo.interface_name, V8TestObject::domTemplate(isol
ate, world), V8TestSubObject::internalFieldCount); |
151 | 154 |
152 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp
late); | 155 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp
late); |
153 ALLOW_UNUSED_LOCAL(signature); | 156 ALLOW_UNUSED_LOCAL(signature); |
154 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTe
mplate(); | 157 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTe
mplate(); |
155 ALLOW_UNUSED_LOCAL(instanceTemplate); | 158 ALLOW_UNUSED_LOCAL(instanceTemplate); |
156 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototype
Template(); | 159 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototype
Template(); |
157 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 160 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
158 | 161 |
159 // Register DOM constants, attributes and operations. | 162 // Register IDL constants, attributes and operations. |
160 V8DOMConfiguration::InstallAccessors(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestSubObjectAccessors, WTF_ARRAY_LE
NGTH(V8TestSubObjectAccessors)); | 163 V8DOMConfiguration::InstallAccessors(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestSubObjectAccessors, WTF_ARRAY_LE
NGTH(V8TestSubObjectAccessors)); |
161 } | 164 } |
162 | 165 |
163 v8::Local<v8::FunctionTemplate> V8TestSubObject::domTemplate(v8::Isolate* isolat
e, const DOMWrapperWorld& world) { | 166 v8::Local<v8::FunctionTemplate> V8TestSubObject::domTemplate(v8::Isolate* isolat
e, const DOMWrapperWorld& world) { |
164 return V8DOMConfiguration::DomClassTemplate(isolate, world, const_cast<Wrapper
TypeInfo*>(&wrapperTypeInfo), installV8TestSubObjectTemplate); | 167 return V8DOMConfiguration::DomClassTemplate(isolate, world, const_cast<Wrapper
TypeInfo*>(&wrapperTypeInfo), installV8TestSubObjectTemplate); |
165 } | 168 } |
166 | 169 |
167 bool V8TestSubObject::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* iso
late) { | 170 bool V8TestSubObject::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* iso
late) { |
168 return V8PerIsolateData::From(isolate)->HasInstance(&wrapperTypeInfo, v8Value)
; | 171 return V8PerIsolateData::From(isolate)->HasInstance(&wrapperTypeInfo, v8Value)
; |
169 } | 172 } |
170 | 173 |
171 v8::Local<v8::Object> V8TestSubObject::findInstanceInPrototypeChain(v8::Local<v8
::Value> v8Value, v8::Isolate* isolate) { | 174 v8::Local<v8::Object> V8TestSubObject::findInstanceInPrototypeChain(v8::Local<v8
::Value> v8Value, v8::Isolate* isolate) { |
172 return V8PerIsolateData::From(isolate)->FindInstanceInPrototypeChain(&wrapperT
ypeInfo, v8Value); | 175 return V8PerIsolateData::From(isolate)->FindInstanceInPrototypeChain(&wrapperT
ypeInfo, v8Value); |
173 } | 176 } |
174 | 177 |
175 TestSubObject* V8TestSubObject::toImplWithTypeCheck(v8::Isolate* isolate, v8::Lo
cal<v8::Value> value) { | 178 TestSubObject* V8TestSubObject::toImplWithTypeCheck(v8::Isolate* isolate, v8::Lo
cal<v8::Value> value) { |
176 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)
) : nullptr; | 179 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)
) : nullptr; |
177 } | 180 } |
178 | 181 |
179 TestSubObject* NativeValueTraits<TestSubObject>::NativeValue(v8::Isolate* isolat
e, v8::Local<v8::Value> value, ExceptionState& exceptionState) { | 182 TestSubObject* NativeValueTraits<TestSubObject>::NativeValue(v8::Isolate* isolat
e, v8::Local<v8::Value> value, ExceptionState& exceptionState) { |
180 TestSubObject* nativeValue = V8TestSubObject::toImplWithTypeCheck(isolate, val
ue); | 183 TestSubObject* nativeValue = V8TestSubObject::toImplWithTypeCheck(isolate, val
ue); |
181 if (!nativeValue) { | 184 if (!nativeValue) { |
182 exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue( | 185 exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue( |
183 "TestSubObject")); | 186 "TestSubObject")); |
184 } | 187 } |
185 return nativeValue; | 188 return nativeValue; |
186 } | 189 } |
187 | 190 |
188 } // namespace blink | 191 } // namespace blink |
OLD | NEW |