| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 | 6 |
| 7 #include "config.h" | 7 #include "config.h" |
| 8 #include "V8TestInterfaceEmpty.h" | 8 #include "V8TestInterfaceDoNotCheckConstants.h" |
| 9 | 9 |
| 10 #include "RuntimeEnabledFeatures.h" | 10 #include "RuntimeEnabledFeatures.h" |
| 11 #include "bindings/v8/ExceptionState.h" | 11 #include "bindings/v8/ExceptionState.h" |
| 12 #include "bindings/v8/V8DOMConfiguration.h" | 12 #include "bindings/v8/V8DOMConfiguration.h" |
| 13 #include "bindings/v8/V8HiddenValue.h" | 13 #include "bindings/v8/V8HiddenValue.h" |
| 14 #include "bindings/v8/V8ObjectConstructor.h" | 14 #include "bindings/v8/V8ObjectConstructor.h" |
| 15 #include "core/dom/ContextFeatures.h" | 15 #include "core/dom/ContextFeatures.h" |
| 16 #include "core/dom/Document.h" | 16 #include "core/dom/Document.h" |
| 17 #include "platform/TraceEvent.h" | 17 #include "platform/TraceEvent.h" |
| 18 #include "wtf/GetPtr.h" | 18 #include "wtf/GetPtr.h" |
| 19 #include "wtf/RefPtr.h" | 19 #include "wtf/RefPtr.h" |
| 20 | 20 |
| 21 namespace WebCore { | 21 namespace WebCore { |
| 22 | 22 |
| 23 static void initializeScriptWrappableForInterface(TestInterfaceEmpty* object) | 23 static void initializeScriptWrappableForInterface(TestInterfaceDoNotCheckConstan
ts* object) |
| 24 { | 24 { |
| 25 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 25 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 26 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceEmpty::wrap
perTypeInfo); | 26 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceDoNotCheckC
onstants::wrapperTypeInfo); |
| 27 else | 27 else |
| 28 ASSERT_NOT_REACHED(); | 28 ASSERT_NOT_REACHED(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace WebCore | 31 } // namespace WebCore |
| 32 | 32 |
| 33 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceEmpty* o
bject) | 33 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceDoNotChe
ckConstants* object) |
| 34 { | 34 { |
| 35 WebCore::initializeScriptWrappableForInterface(object); | 35 WebCore::initializeScriptWrappableForInterface(object); |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 const WrapperTypeInfo V8TestInterfaceEmpty::wrapperTypeInfo = { gin::kEmbedderBl
ink, V8TestInterfaceEmpty::domTemplate, V8TestInterfaceEmpty::derefObject, 0, 0,
0, V8TestInterfaceEmpty::installPerContextEnabledMethods, 0, WrapperTypeObjectP
rototype, false }; | 39 const WrapperTypeInfo V8TestInterfaceDoNotCheckConstants::wrapperTypeInfo = { gi
n::kEmbedderBlink, V8TestInterfaceDoNotCheckConstants::domTemplate, V8TestInterf
aceDoNotCheckConstants::derefObject, 0, 0, 0, V8TestInterfaceDoNotCheckConstants
::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, false }; |
| 40 | 40 |
| 41 namespace TestInterfaceEmptyV8Internal { | 41 namespace TestInterfaceDoNotCheckConstantsV8Internal { |
| 42 | 42 |
| 43 template <typename T> void V8_USE(T) { } | 43 template <typename T> void V8_USE(T) { } |
| 44 | 44 |
| 45 } // namespace TestInterfaceEmptyV8Internal | 45 } // namespace TestInterfaceDoNotCheckConstantsV8Internal |
| 46 | 46 |
| 47 static void configureV8TestInterfaceEmptyTemplate(v8::Handle<v8::FunctionTemplat
e> functionTemplate, v8::Isolate* isolate) | 47 static void configureV8TestInterfaceDoNotCheckConstantsTemplate(v8::Handle<v8::F
unctionTemplate> functionTemplate, v8::Isolate* isolate) |
| 48 { | 48 { |
| 49 functionTemplate->ReadOnlyPrototype(); | 49 functionTemplate->ReadOnlyPrototype(); |
| 50 | 50 |
| 51 v8::Local<v8::Signature> defaultSignature; | 51 v8::Local<v8::Signature> defaultSignature; |
| 52 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceEmpty", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceEmp
ty::internalFieldCount, | 52 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceDoNotCheckConstants", v8::Local<v8::FunctionTemplate>(), V8Te
stInterfaceDoNotCheckConstants::internalFieldCount, |
| 53 0, 0, | 53 0, 0, |
| 54 0, 0, | 54 0, 0, |
| 55 0, 0, | 55 0, 0, |
| 56 isolate); | 56 isolate); |
| 57 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 57 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 58 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 58 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 59 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceDoNotC
heckConstantsConstants[] = { |
| 60 {"CONST_VALUE_0", 0}, |
| 61 {"CONST_JAVASCRIPT", 1}, |
| 62 }; |
| 63 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
TestInterfaceDoNotCheckConstantsConstants, WTF_ARRAY_LENGTH(V8TestInterfaceDoNot
CheckConstantsConstants), isolate); |
| 59 | 64 |
| 60 // Custom toString template | 65 // Custom toString template |
| 61 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 66 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
| 62 } | 67 } |
| 63 | 68 |
| 64 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEmpty::domTemplate(v8::Isolate*
isolate) | 69 v8::Handle<v8::FunctionTemplate> V8TestInterfaceDoNotCheckConstants::domTemplate
(v8::Isolate* isolate) |
| 65 { | 70 { |
| 66 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 71 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 67 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas
t<WrapperTypeInfo*>(&wrapperTypeInfo)); | 72 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas
t<WrapperTypeInfo*>(&wrapperTypeInfo)); |
| 68 if (!result.IsEmpty()) | 73 if (!result.IsEmpty()) |
| 69 return result; | 74 return result; |
| 70 | 75 |
| 71 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 76 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 72 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); | 77 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); |
| 73 configureV8TestInterfaceEmptyTemplate(result, isolate); | 78 configureV8TestInterfaceDoNotCheckConstantsTemplate(result, isolate); |
| 74 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; | 79 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; |
| 75 return result; | 80 return result; |
| 76 } | 81 } |
| 77 | 82 |
| 78 bool V8TestInterfaceEmpty::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolat
e* isolate) | 83 bool V8TestInterfaceDoNotCheckConstants::hasInstance(v8::Handle<v8::Value> v8Val
ue, v8::Isolate* isolate) |
| 79 { | 84 { |
| 80 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | 85 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
| 81 } | 86 } |
| 82 | 87 |
| 83 v8::Handle<v8::Object> V8TestInterfaceEmpty::findInstanceInPrototypeChain(v8::Ha
ndle<v8::Value> v8Value, v8::Isolate* isolate) | 88 v8::Handle<v8::Object> V8TestInterfaceDoNotCheckConstants::findInstanceInPrototy
peChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) |
| 84 { | 89 { |
| 85 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 90 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 86 } | 91 } |
| 87 | 92 |
| 88 TestInterfaceEmpty* V8TestInterfaceEmpty::toNativeWithTypeCheck(v8::Isolate* iso
late, v8::Handle<v8::Value> value) | 93 TestInterfaceDoNotCheckConstants* V8TestInterfaceDoNotCheckConstants::toNativeWi
thTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) |
| 89 { | 94 { |
| 90 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; | 95 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
| 91 } | 96 } |
| 92 | 97 |
| 93 v8::Handle<v8::Object> V8TestInterfaceEmpty::createWrapper(PassRefPtr<TestInterf
aceEmpty> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 98 v8::Handle<v8::Object> V8TestInterfaceDoNotCheckConstants::createWrapper(PassRef
Ptr<TestInterfaceDoNotCheckConstants> impl, v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) |
| 94 { | 99 { |
| 95 ASSERT(impl); | 100 ASSERT(impl); |
| 96 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceEmpty>(impl.get(), isol
ate)); | 101 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceDoNotCheckConstants>(im
pl.get(), isolate)); |
| 97 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 102 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| 98 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 103 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
| 99 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have | 104 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
| 100 // the same object de-ref functions, though, so use that as the basis of
the check. | 105 // the same object de-ref functions, though, so use that as the basis of
the check. |
| 101 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); | 106 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
| 102 } | 107 } |
| 103 | 108 |
| 104 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); | 109 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
| 105 if (UNLIKELY(wrapper.IsEmpty())) | 110 if (UNLIKELY(wrapper.IsEmpty())) |
| 106 return wrapper; | 111 return wrapper; |
| 107 | 112 |
| 108 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 113 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
| 109 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEmpty>(impl, &wrappe
rTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); | 114 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceDoNotCheckConstants>
(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); |
| 110 return wrapper; | 115 return wrapper; |
| 111 } | 116 } |
| 112 | 117 |
| 113 void V8TestInterfaceEmpty::derefObject(void* object) | 118 void V8TestInterfaceDoNotCheckConstants::derefObject(void* object) |
| 114 { | 119 { |
| 115 fromInternalPointer(object)->deref(); | 120 fromInternalPointer(object)->deref(); |
| 116 } | 121 } |
| 117 | 122 |
| 118 template<> | 123 template<> |
| 119 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEmpty* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 124 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDoNotCheckConstants* impl, v8::H
andle<v8::Object> creationContext, v8::Isolate* isolate) |
| 120 { | 125 { |
| 121 return toV8(impl, creationContext, isolate); | 126 return toV8(impl, creationContext, isolate); |
| 122 } | 127 } |
| 123 | 128 |
| 124 } // namespace WebCore | 129 } // namespace WebCore |
| OLD | NEW |