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