| 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 28 matching lines...) Expand all Loading... |
| 39 #include "bindings/v8/ExceptionMessages.h" | 39 #include "bindings/v8/ExceptionMessages.h" |
| 40 #include "bindings/v8/ExceptionState.h" | 40 #include "bindings/v8/ExceptionState.h" |
| 41 #include "bindings/v8/V8Binding.h" | 41 #include "bindings/v8/V8Binding.h" |
| 42 #include "bindings/v8/V8DOMConfiguration.h" | 42 #include "bindings/v8/V8DOMConfiguration.h" |
| 43 #include "bindings/v8/V8DOMWrapper.h" | 43 #include "bindings/v8/V8DOMWrapper.h" |
| 44 #include "core/dom/ContextFeatures.h" | 44 #include "core/dom/ContextFeatures.h" |
| 45 #include "core/dom/Document.h" | 45 #include "core/dom/Document.h" |
| 46 #include "platform/TraceEvent.h" | 46 #include "platform/TraceEvent.h" |
| 47 #include "wtf/GetPtr.h" | 47 #include "wtf/GetPtr.h" |
| 48 #include "wtf/RefPtr.h" | 48 #include "wtf/RefPtr.h" |
| 49 #include "wtf/UnusedParam.h" | |
| 50 | 49 |
| 51 namespace WebCore { | 50 namespace WebCore { |
| 52 | 51 |
| 53 static void initializeScriptWrappableForInterface(TestEventTarget* object) | 52 static void initializeScriptWrappableForInterface(TestEventTarget* object) |
| 54 { | 53 { |
| 55 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 54 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 56 ScriptWrappable::setTypeInfoInObject(object, &V8TestEventTarget::wrapper
TypeInfo); | 55 ScriptWrappable::setTypeInfoInObject(object, &V8TestEventTarget::wrapper
TypeInfo); |
| 57 else | 56 else |
| 58 ASSERT_NOT_REACHED(); | 57 ASSERT_NOT_REACHED(); |
| 59 } | 58 } |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 275 |
| 277 static const V8DOMConfiguration::MethodConfiguration V8TestEventTargetMethods[]
= { | 276 static const V8DOMConfiguration::MethodConfiguration V8TestEventTargetMethods[]
= { |
| 278 {"item", TestEventTargetV8Internal::itemMethodCallback, 0, 1}, | 277 {"item", TestEventTargetV8Internal::itemMethodCallback, 0, 1}, |
| 279 {"namedItem", TestEventTargetV8Internal::namedItemMethodCallback, 0, 1}, | 278 {"namedItem", TestEventTargetV8Internal::namedItemMethodCallback, 0, 1}, |
| 280 }; | 279 }; |
| 281 | 280 |
| 282 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestEventTargetTemplate(v8::H
andle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorld
Type currentWorldType) | 281 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestEventTargetTemplate(v8::H
andle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorld
Type currentWorldType) |
| 283 { | 282 { |
| 284 functionTemplate->ReadOnlyPrototype(); | 283 functionTemplate->ReadOnlyPrototype(); |
| 285 | 284 |
| 286 v8::Local<v8::Signature> defaultSignature; | 285 v8::Local<v8::Signature> ALLOW_UNUSED defaultSignature; |
| 287 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestEventTarget", V8EventTarget::GetTemplate(isolate, currentWorldType), V
8TestEventTarget::internalFieldCount, | 286 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestEventTarget", V8EventTarget::GetTemplate(isolate, currentWorldType), V
8TestEventTarget::internalFieldCount, |
| 288 0, 0, | 287 0, 0, |
| 289 0, 0, | 288 0, 0, |
| 290 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), | 289 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), |
| 291 isolate, currentWorldType); | 290 isolate, currentWorldType); |
| 292 UNUSED_PARAM(defaultSignature); | 291 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 293 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 292 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 294 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
| 295 UNUSED_PARAM(instanceTemplate); | |
| 296 UNUSED_PARAM(prototypeTemplate); | |
| 297 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestEventTar
getV8Internal::indexedPropertyGetterCallback, TestEventTargetV8Internal::indexed
PropertySetterCallback, 0, TestEventTargetV8Internal::indexedPropertyDeleterCall
back, indexedPropertyEnumerator<TestEventTarget>); | 293 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestEventTar
getV8Internal::indexedPropertyGetterCallback, TestEventTargetV8Internal::indexed
PropertySetterCallback, 0, TestEventTargetV8Internal::indexedPropertyDeleterCall
back, indexedPropertyEnumerator<TestEventTarget>); |
| 298 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestEventTarge
tV8Internal::namedPropertyGetterCallback, TestEventTargetV8Internal::namedProper
tySetterCallback, TestEventTargetV8Internal::namedPropertyQueryCallback, TestEve
ntTargetV8Internal::namedPropertyDeleterCallback, TestEventTargetV8Internal::nam
edPropertyEnumeratorCallback); | 294 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestEventTarge
tV8Internal::namedPropertyGetterCallback, TestEventTargetV8Internal::namedProper
tySetterCallback, TestEventTargetV8Internal::namedPropertyQueryCallback, TestEve
ntTargetV8Internal::namedPropertyDeleterCallback, TestEventTargetV8Internal::nam
edPropertyEnumeratorCallback); |
| 299 | 295 |
| 300 // Custom toString template | 296 // Custom toString template |
| 301 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 297 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 302 return functionTemplate; | 298 return functionTemplate; |
| 303 } | 299 } |
| 304 | 300 |
| 305 v8::Handle<v8::FunctionTemplate> V8TestEventTarget::GetTemplate(v8::Isolate* iso
late, WrapperWorldType currentWorldType) | 301 v8::Handle<v8::FunctionTemplate> V8TestEventTarget::GetTemplate(v8::Isolate* iso
late, WrapperWorldType currentWorldType) |
| 306 { | 302 { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 fromInternalPointer(object)->deref(); | 355 fromInternalPointer(object)->deref(); |
| 360 } | 356 } |
| 361 | 357 |
| 362 template<> | 358 template<> |
| 363 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) | 359 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) |
| 364 { | 360 { |
| 365 return toV8(impl, creationContext, isolate); | 361 return toV8(impl, creationContext, isolate); |
| 366 } | 362 } |
| 367 | 363 |
| 368 } // namespace WebCore | 364 } // namespace WebCore |
| OLD | NEW |