OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 | 193 |
194 static void reflectUrlStringAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 194 static void reflectUrlStringAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
195 { | 195 { |
196 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 196 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
197 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 197 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
198 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(jsValu
e, info); | 198 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(jsValu
e, info); |
199 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 199 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
200 } | 200 } |
201 | 201 |
| 202 static void testInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 203 { |
| 204 TestInterfaceNode* imp = V8TestInterfaceNode::toNative(info.Holder()); |
| 205 v8SetReturnValueFast(info, imp->testInterfaceEmptyMethod(), imp); |
| 206 } |
| 207 |
| 208 static void testInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 209 { |
| 210 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 211 TestInterfaceNodeV8Internal::testInterfaceEmptyMethodMethod(info); |
| 212 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 213 } |
| 214 |
202 } // namespace TestInterfaceNodeV8Internal | 215 } // namespace TestInterfaceNodeV8Internal |
203 | 216 |
204 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNodeAttri
butes[] = { | 217 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNodeAttri
butes[] = { |
205 {"stringAttribute", TestInterfaceNodeV8Internal::stringAttributeAttributeGet
terCallback, TestInterfaceNodeV8Internal::stringAttributeAttributeSetterCallback
, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), 0 /* on instance */}, | 218 {"stringAttribute", TestInterfaceNodeV8Internal::stringAttributeAttributeGet
terCallback, TestInterfaceNodeV8Internal::stringAttributeAttributeSetterCallback
, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), 0 /* on instance */}, |
206 {"readonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8Internal::readonl
yTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8:
:AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /*
on instance */}, | 219 {"readonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8Internal::readonl
yTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8:
:AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /*
on instance */}, |
207 {"eventHandlerAttribute", TestInterfaceNodeV8Internal::eventHandlerAttribute
AttributeGetterCallback, TestInterfaceNodeV8Internal::eventHandlerAttributeAttri
buteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static
_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 220 {"eventHandlerAttribute", TestInterfaceNodeV8Internal::eventHandlerAttribute
AttributeGetterCallback, TestInterfaceNodeV8Internal::eventHandlerAttributeAttri
buteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static
_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
208 {"reflectStringAttribute", TestInterfaceNodeV8Internal::reflectStringAttribu
teAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectStringAttributeAt
tributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta
tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 221 {"reflectStringAttribute", TestInterfaceNodeV8Internal::reflectStringAttribu
teAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectStringAttributeAt
tributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta
tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
209 {"reflectUrlStringAttribute", TestInterfaceNodeV8Internal::reflectUrlStringA
ttributeAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectUrlStringAt
tributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFA
ULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 222 {"reflectUrlStringAttribute", TestInterfaceNodeV8Internal::reflectUrlStringA
ttributeAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectUrlStringAt
tributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFA
ULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
210 }; | 223 }; |
211 | 224 |
| 225 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceNodeMethods[
] = { |
| 226 {"testInterfaceEmptyMethod", TestInterfaceNodeV8Internal::testInterfaceEmpty
MethodMethodCallback, 0, 0}, |
| 227 }; |
| 228 |
212 static void configureV8TestInterfaceNodeTemplate(v8::Handle<v8::FunctionTemplate
> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) | 229 static void configureV8TestInterfaceNodeTemplate(v8::Handle<v8::FunctionTemplate
> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
213 { | 230 { |
214 functionTemplate->ReadOnlyPrototype(); | 231 functionTemplate->ReadOnlyPrototype(); |
215 | 232 |
216 v8::Local<v8::Signature> defaultSignature; | 233 v8::Local<v8::Signature> defaultSignature; |
217 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceNode", V8Node::domTemplate(isolate, currentWorldType), V8Test
InterfaceNode::internalFieldCount, | 234 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceNode", V8Node::domTemplate(isolate, currentWorldType), V8Test
InterfaceNode::internalFieldCount, |
218 V8TestInterfaceNodeAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceNodeAttri
butes), | 235 V8TestInterfaceNodeAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceNodeAttri
butes), |
219 0, 0, | 236 0, 0, |
220 0, 0, | 237 V8TestInterfaceNodeMethods, WTF_ARRAY_LENGTH(V8TestInterfaceNodeMethods)
, |
221 isolate, currentWorldType); | 238 isolate, currentWorldType); |
222 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 239 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
223 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 240 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
224 | 241 |
225 // Custom toString template | 242 // Custom toString template |
226 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 243 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
227 } | 244 } |
228 | 245 |
229 v8::Handle<v8::FunctionTemplate> V8TestInterfaceNode::domTemplate(v8::Isolate* i
solate, WrapperWorldType currentWorldType) | 246 v8::Handle<v8::FunctionTemplate> V8TestInterfaceNode::domTemplate(v8::Isolate* i
solate, WrapperWorldType currentWorldType) |
230 { | 247 { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 fromInternalPointer(object)->deref(); | 300 fromInternalPointer(object)->deref(); |
284 } | 301 } |
285 | 302 |
286 template<> | 303 template<> |
287 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) | 304 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) |
288 { | 305 { |
289 return toV8(impl, creationContext, isolate); | 306 return toV8(impl, creationContext, isolate); |
290 } | 307 } |
291 | 308 |
292 } // namespace WebCore | 309 } // namespace WebCore |
OLD | NEW |