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