| 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 "V8TestInterfaceAccessors.h" | 8 #include "V8TestInterfaceAccessors.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 static void exposeJSAccessorAttributeAttributeSetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 98 static void exposeJSAccessorAttributeAttributeSetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
| 99 { | 99 { |
| 100 v8::Local<v8::Value> v8Value = info[0]; | 100 v8::Local<v8::Value> v8Value = info[0]; |
| 101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 102 TestInterfaceAccessorsV8Internal::exposeJSAccessorAttributeAttributeSetter(v
8Value, info); | 102 TestInterfaceAccessorsV8Internal::exposeJSAccessorAttributeAttributeSetter(v
8Value, info); |
| 103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 104 } | 104 } |
| 105 | 105 |
| 106 static void doNotExposeJSAccessorAttributeAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | 106 static void doNotExposeJSAccessorAttributeAttributeGetter(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 107 { | 107 { |
| 108 v8::Local<v8::Object> holder = info.Holder(); | 108 v8::Local<v8::Object> holder = info.Holder(); |
| 109 TestInterfaceAccessors* impl = V8TestInterfaceAccessors::toImpl(holder); | 109 TestInterfaceAccessors* impl = V8TestInterfaceAccessors::toImpl(holder); |
| 110 v8SetReturnValueInt(info, impl->doNotExposeJSAccessorAttribute()); | 110 v8SetReturnValueInt(info, impl->doNotExposeJSAccessorAttribute()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 static void doNotExposeJSAccessorAttributeAttributeGetterCallback(v8::Local<v8::
Name>, const v8::PropertyCallbackInfo<v8::Value>& info) | 113 static void doNotExposeJSAccessorAttributeAttributeGetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) |
| 114 { | 114 { |
| 115 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 115 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 116 TestInterfaceAccessorsV8Internal::doNotExposeJSAccessorAttributeAttributeGet
ter(info); | 116 TestInterfaceAccessorsV8Internal::doNotExposeJSAccessorAttributeAttributeGet
ter(info); |
| 117 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 117 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 118 } | 118 } |
| 119 | 119 |
| 120 static void doNotExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<void>& info) | 120 static void doNotExposeJSAccessorAttributeAttributeSetter(v8::Local<v8::Value> v
8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 121 { | 121 { |
| 122 v8::Local<v8::Object> holder = info.Holder(); | 122 v8::Local<v8::Object> holder = info.Holder(); |
| 123 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotExposeJSA
ccessorAttribute", "TestInterfaceAccessors", holder, info.GetIsolate()); | 123 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotExposeJSA
ccessorAttribute", "TestInterfaceAccessors", holder, info.GetIsolate()); |
| 124 TestInterfaceAccessors* impl = V8TestInterfaceAccessors::toImpl(holder); | 124 TestInterfaceAccessors* impl = V8TestInterfaceAccessors::toImpl(holder); |
| 125 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); | 125 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, excepti
onState); |
| 126 if (exceptionState.throwIfNeeded()) | 126 if (exceptionState.throwIfNeeded()) |
| 127 return; | 127 return; |
| 128 impl->setDoNotExposeJSAccessorAttribute(cppValue); | 128 impl->setDoNotExposeJSAccessorAttribute(cppValue); |
| 129 } | 129 } |
| 130 | 130 |
| 131 static void doNotExposeJSAccessorAttributeAttributeSetterCallback(v8::Local<v8::
Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 131 static void doNotExposeJSAccessorAttributeAttributeSetterCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) |
| 132 { | 132 { |
| 133 v8::Local<v8::Value> v8Value = info[0]; |
| 133 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 134 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 134 TestInterfaceAccessorsV8Internal::doNotExposeJSAccessorAttributeAttributeSet
ter(v8Value, info); | 135 TestInterfaceAccessorsV8Internal::doNotExposeJSAccessorAttributeAttributeSet
ter(v8Value, info); |
| 135 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 136 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 136 } | 137 } |
| 137 | 138 |
| 138 } // namespace TestInterfaceAccessorsV8Internal | 139 } // namespace TestInterfaceAccessorsV8Internal |
| 139 | 140 |
| 140 // Suppress warning: global constructors, because AttributeConfiguration is triv
ial | |
| 141 // and does not depend on another global objects. | |
| 142 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | |
| 143 #pragma clang diagnostic push | |
| 144 #pragma clang diagnostic ignored "-Wglobal-constructors" | |
| 145 #endif | |
| 146 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAccessors
Attributes[] = { | |
| 147 {"doNotExposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::doNotEx
poseJSAccessorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal
::doNotExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8
::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8D
OMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfi
guration::CheckHolder}, | |
| 148 }; | |
| 149 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | |
| 150 #pragma clang diagnostic pop | |
| 151 #endif | |
| 152 | |
| 153 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceAccessorsA
ccessors[] = { | 141 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceAccessorsA
ccessors[] = { |
| 154 {"noExposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::noExposeJS
AccessorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal::noEx
poseJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessC
ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfigu
ration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration
::CheckHolder}, | 142 {"noExposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::noExposeJS
AccessorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal::noEx
poseJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cas
t<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8D
OMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 155 {"exposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::exposeJSAcce
ssorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal::exposeJS
AccessorAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration
::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::Chec
kHolder}, | 143 {"exposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::exposeJSAcce
ssorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal::exposeJS
AccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::
PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConf
iguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 144 {"doNotExposeJSAccessorAttribute", TestInterfaceAccessorsV8Internal::doNotEx
poseJSAccessorAttributeAttributeGetterCallback, TestInterfaceAccessorsV8Internal
::doNotExposeJSAccessorAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, s
tatic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScr
ipts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder}, |
| 156 }; | 145 }; |
| 157 | 146 |
| 158 static void installV8TestInterfaceAccessorsTemplate(v8::Local<v8::FunctionTempla
te> functionTemplate, v8::Isolate* isolate) | 147 static void installV8TestInterfaceAccessorsTemplate(v8::Local<v8::FunctionTempla
te> functionTemplate, v8::Isolate* isolate) |
| 159 { | 148 { |
| 160 functionTemplate->ReadOnlyPrototype(); | 149 functionTemplate->ReadOnlyPrototype(); |
| 161 | 150 |
| 162 v8::Local<v8::Signature> defaultSignature; | 151 v8::Local<v8::Signature> defaultSignature; |
| 163 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceAccessors", V8TestInterfaceEmpty::domTemplate(isolat
e), V8TestInterfaceAccessors::internalFieldCount, | 152 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func
tionTemplate, "TestInterfaceAccessors", V8TestInterfaceEmpty::domTemplate(isolat
e), V8TestInterfaceAccessors::internalFieldCount, |
| 164 V8TestInterfaceAccessorsAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAcce
ssorsAttributes), | 153 0, 0, |
| 165 V8TestInterfaceAccessorsAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceAcces
sorsAccessors), | 154 V8TestInterfaceAccessorsAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceAcces
sorsAccessors), |
| 166 0, 0); | 155 0, 0); |
| 167 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 156 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); |
| 168 ALLOW_UNUSED_LOCAL(instanceTemplate); | 157 ALLOW_UNUSED_LOCAL(instanceTemplate); |
| 169 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 158 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); |
| 170 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 159 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
| 171 | 160 |
| 172 // Custom toString template | 161 // Custom toString template |
| 173 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | 162 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); |
| 174 } | 163 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 197 { | 186 { |
| 198 scriptWrappable->toImpl<TestInterfaceAccessors>()->ref(); | 187 scriptWrappable->toImpl<TestInterfaceAccessors>()->ref(); |
| 199 } | 188 } |
| 200 | 189 |
| 201 void V8TestInterfaceAccessors::derefObject(ScriptWrappable* scriptWrappable) | 190 void V8TestInterfaceAccessors::derefObject(ScriptWrappable* scriptWrappable) |
| 202 { | 191 { |
| 203 scriptWrappable->toImpl<TestInterfaceAccessors>()->deref(); | 192 scriptWrappable->toImpl<TestInterfaceAccessors>()->deref(); |
| 204 } | 193 } |
| 205 | 194 |
| 206 } // namespace blink | 195 } // namespace blink |
| OLD | NEW |