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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "bindings/v8/V8Binding.h" | 47 #include "bindings/v8/V8Binding.h" |
48 #include "bindings/v8/V8DOMConfiguration.h" | 48 #include "bindings/v8/V8DOMConfiguration.h" |
49 #include "bindings/v8/V8DOMWrapper.h" | 49 #include "bindings/v8/V8DOMWrapper.h" |
50 #include "bindings/v8/V8EventListenerList.h" | 50 #include "bindings/v8/V8EventListenerList.h" |
51 #include "bindings/v8/V8ObjectConstructor.h" | 51 #include "bindings/v8/V8ObjectConstructor.h" |
52 #include "core/dom/ContextFeatures.h" | 52 #include "core/dom/ContextFeatures.h" |
53 #include "core/dom/Document.h" | 53 #include "core/dom/Document.h" |
54 #include "platform/TraceEvent.h" | 54 #include "platform/TraceEvent.h" |
55 #include "wtf/GetPtr.h" | 55 #include "wtf/GetPtr.h" |
56 #include "wtf/RefPtr.h" | 56 #include "wtf/RefPtr.h" |
57 #include "wtf/UnusedParam.h" | |
58 | 57 |
59 namespace WebCore { | 58 namespace WebCore { |
60 | 59 |
61 static void initializeScriptWrappableForInterface(TestInterface* object) | 60 static void initializeScriptWrappableForInterface(TestInterface* object) |
62 { | 61 { |
63 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 62 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
64 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterface::wrapperTy
peInfo); | 63 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterface::wrapperTy
peInfo); |
65 else | 64 else |
66 ASSERT_NOT_REACHED(); | 65 ASSERT_NOT_REACHED(); |
67 } | 66 } |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceTemplate(v8::Han
dle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldTy
pe currentWorldType) | 838 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceTemplate(v8::Han
dle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldTy
pe currentWorldType) |
840 { | 839 { |
841 functionTemplate->ReadOnlyPrototype(); | 840 functionTemplate->ReadOnlyPrototype(); |
842 | 841 |
843 v8::Local<v8::Signature> defaultSignature; | 842 v8::Local<v8::Signature> defaultSignature; |
844 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterface::intern
alFieldCount, | 843 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterface::intern
alFieldCount, |
845 V8TestInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAttributes), | 844 V8TestInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAttributes), |
846 0, 0, | 845 0, 0, |
847 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods), | 846 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods), |
848 isolate, currentWorldType); | 847 isolate, currentWorldType); |
849 UNUSED_PARAM(defaultSignature); | |
850 functionTemplate->SetCallHandler(V8TestInterface::constructorCallback); | 848 functionTemplate->SetCallHandler(V8TestInterface::constructorCallback); |
851 functionTemplate->SetLength(1); | 849 functionTemplate->SetLength(1); |
852 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 850 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
853 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 851 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
854 UNUSED_PARAM(instanceTemplate); | |
855 UNUSED_PARAM(prototypeTemplate); | |
856 if (RuntimeEnabledFeatures::featureName23Enabled()) { | 852 if (RuntimeEnabledFeatures::featureName23Enabled()) { |
857 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 853 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
858 {"Node23", TestInterfaceV8Internal::Node23AttributeGetterCallback, TestI
nterfaceV8Internal::Node23AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; | 854 {"Node23", TestInterfaceV8Internal::Node23AttributeGetterCallback, TestI
nterfaceV8Internal::Node23AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; |
859 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); | 855 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); |
860 } | 856 } |
861 #if ENABLE(Condition11) || ENABLE(Condition12) | 857 #if ENABLE(Condition11) || ENABLE(Condition12) |
862 if (RuntimeEnabledFeatures::condition13Enabled()) { | 858 if (RuntimeEnabledFeatures::condition13Enabled()) { |
863 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 859 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
864 {"Node13", TestInterfaceV8Internal::Node13AttributeGetterCallback, TestI
nterfaceV8Internal::Node13AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; | 860 {"Node13", TestInterfaceV8Internal::Node13AttributeGetterCallback, TestI
nterfaceV8Internal::Node13AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; |
865 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); | 861 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 } | 983 } |
988 | 984 |
989 template<> | 985 template<> |
990 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 986 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
991 { | 987 { |
992 return toV8(impl, creationContext, isolate); | 988 return toV8(impl, creationContext, isolate); |
993 } | 989 } |
994 | 990 |
995 } // namespace WebCore | 991 } // namespace WebCore |
996 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 992 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
OLD | NEW |