| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! |
| 32 | 32 |
| 33 #include "config.h" | 33 #include "config.h" |
| 34 #include "V8TestEventTarget.h" | 34 #include "V8TestEventTarget.h" |
| 35 | 35 |
| 36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
| 37 #include "V8Node.h" | 37 #include "V8Node.h" |
| 38 #include "bindings/v8/ExceptionState.h" | 38 #include "bindings/v8/ExceptionState.h" |
| 39 #include "bindings/v8/V8DOMConfiguration.h" | 39 #include "bindings/v8/V8DOMConfiguration.h" |
| 40 #include "bindings/v8/V8ObjectConstructor.h" |
| 40 #include "core/dom/ContextFeatures.h" | 41 #include "core/dom/ContextFeatures.h" |
| 41 #include "core/dom/Document.h" | 42 #include "core/dom/Document.h" |
| 42 #include "platform/TraceEvent.h" | 43 #include "platform/TraceEvent.h" |
| 43 #include "wtf/GetPtr.h" | 44 #include "wtf/GetPtr.h" |
| 44 #include "wtf/RefPtr.h" | 45 #include "wtf/RefPtr.h" |
| 45 | 46 |
| 46 namespace WebCore { | 47 namespace WebCore { |
| 47 | 48 |
| 48 static void initializeScriptWrappableForInterface(TestEventTarget* object) | 49 static void initializeScriptWrappableForInterface(TestEventTarget* object) |
| 49 { | 50 { |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 270 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 270 } | 271 } |
| 271 | 272 |
| 272 } // namespace TestEventTargetV8Internal | 273 } // namespace TestEventTargetV8Internal |
| 273 | 274 |
| 274 static const V8DOMConfiguration::MethodConfiguration V8TestEventTargetMethods[]
= { | 275 static const V8DOMConfiguration::MethodConfiguration V8TestEventTargetMethods[]
= { |
| 275 {"item", TestEventTargetV8Internal::itemMethodCallback, 0, 1}, | 276 {"item", TestEventTargetV8Internal::itemMethodCallback, 0, 1}, |
| 276 {"namedItem", TestEventTargetV8Internal::namedItemMethodCallback, 0, 1}, | 277 {"namedItem", TestEventTargetV8Internal::namedItemMethodCallback, 0, 1}, |
| 277 }; | 278 }; |
| 278 | 279 |
| 279 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestEventTargetTemplate(v8::H
andle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorld
Type currentWorldType) | 280 static void configureV8TestEventTargetTemplate(v8::Handle<v8::FunctionTemplate>
functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| 280 { | 281 { |
| 281 functionTemplate->ReadOnlyPrototype(); | 282 functionTemplate->ReadOnlyPrototype(); |
| 282 | 283 |
| 283 v8::Local<v8::Signature> defaultSignature; | 284 v8::Local<v8::Signature> defaultSignature; |
| 284 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestEventTarget", V8EventTarget::domTemplate(isolate, currentWorldType), V
8TestEventTarget::internalFieldCount, | 285 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestEventTarget", V8EventTarget::domTemplate(isolate, currentWorldType), V
8TestEventTarget::internalFieldCount, |
| 285 0, 0, | 286 0, 0, |
| 286 0, 0, | 287 0, 0, |
| 287 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), | 288 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), |
| 288 isolate, currentWorldType); | 289 isolate, currentWorldType); |
| 289 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 290 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 290 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 291 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 291 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestEventTar
getV8Internal::indexedPropertyGetterCallback, TestEventTargetV8Internal::indexed
PropertySetterCallback, 0, TestEventTargetV8Internal::indexedPropertyDeleterCall
back, indexedPropertyEnumerator<TestEventTarget>); | 292 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestEventTar
getV8Internal::indexedPropertyGetterCallback, TestEventTargetV8Internal::indexed
PropertySetterCallback, 0, TestEventTargetV8Internal::indexedPropertyDeleterCall
back, indexedPropertyEnumerator<TestEventTarget>); |
| 292 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestEventTarge
tV8Internal::namedPropertyGetterCallback, TestEventTargetV8Internal::namedProper
tySetterCallback, TestEventTargetV8Internal::namedPropertyQueryCallback, TestEve
ntTargetV8Internal::namedPropertyDeleterCallback, TestEventTargetV8Internal::nam
edPropertyEnumeratorCallback); | 293 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestEventTarge
tV8Internal::namedPropertyGetterCallback, TestEventTargetV8Internal::namedProper
tySetterCallback, TestEventTargetV8Internal::namedPropertyQueryCallback, TestEve
ntTargetV8Internal::namedPropertyDeleterCallback, TestEventTargetV8Internal::nam
edPropertyEnumeratorCallback); |
| 293 | 294 |
| 294 // Custom toString template | 295 // Custom toString template |
| 295 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 296 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 296 return functionTemplate; | |
| 297 } | 297 } |
| 298 | 298 |
| 299 v8::Handle<v8::FunctionTemplate> V8TestEventTarget::domTemplate(v8::Isolate* iso
late, WrapperWorldType currentWorldType) | 299 v8::Handle<v8::FunctionTemplate> V8TestEventTarget::domTemplate(v8::Isolate* iso
late, WrapperWorldType currentWorldType) |
| 300 { | 300 { |
| 301 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 301 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 302 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 302 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| 303 if (result != data->templateMap(currentWorldType).end()) | 303 if (result != data->templateMap(currentWorldType).end()) |
| 304 return result->value.newLocal(isolate); | 304 return result->value.newLocal(isolate); |
| 305 | 305 |
| 306 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 306 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 307 v8::EscapableHandleScope handleScope(isolate); | 307 v8::EscapableHandleScope handleScope(isolate); |
| 308 v8::Local<v8::FunctionTemplate> templ = | 308 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 309 ConfigureV8TestEventTargetTemplate(data->rawDOMTemplate(&wrapperTypeInfo
, currentWorldType), isolate, currentWorldType); | 309 configureV8TestEventTargetTemplate(templ, isolate, currentWorldType); |
| 310 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 310 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 311 return handleScope.Escape(templ); | 311 return handleScope.Escape(templ); |
| 312 } | 312 } |
| 313 | 313 |
| 314 bool V8TestEventTarget::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate*
isolate, WrapperWorldType currentWorldType) | 314 bool V8TestEventTarget::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate*
isolate, WrapperWorldType currentWorldType) |
| 315 { | 315 { |
| 316 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 316 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
| 317 } | 317 } |
| 318 | 318 |
| 319 bool V8TestEventTarget::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8:
:Isolate* isolate) | 319 bool V8TestEventTarget::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8:
:Isolate* isolate) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 fromInternalPointer(object)->deref(); | 353 fromInternalPointer(object)->deref(); |
| 354 } | 354 } |
| 355 | 355 |
| 356 template<> | 356 template<> |
| 357 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) | 357 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) |
| 358 { | 358 { |
| 359 return toV8(impl, creationContext, isolate); | 359 return toV8(impl, creationContext, isolate); |
| 360 } | 360 } |
| 361 | 361 |
| 362 } // namespace WebCore | 362 } // namespace WebCore |
| OLD | NEW |