| 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 "V8TestEventTarget.h" | 8 #include "V8TestEventTarget.h" |
| 9 | 9 |
| 10 #include "RuntimeEnabledFeatures.h" | 10 #include "RuntimeEnabledFeatures.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); | 90 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); |
| 91 } | 91 } |
| 92 | 92 |
| 93 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 93 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
| 94 { | 94 { |
| 95 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 95 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
| 96 TestEventTargetV8Internal::indexedPropertyGetter(index, info); | 96 TestEventTargetV8Internal::indexedPropertyGetter(index, info); |
| 97 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 97 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 98 } | 98 } |
| 99 | 99 |
| 100 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<v8::Value>& info) | 100 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) |
| 101 { | 101 { |
| 102 TestEventTarget* impl = V8TestEventTarget::toNative(info.Holder()); | 102 TestEventTarget* impl = V8TestEventTarget::toNative(info.Holder()); |
| 103 V8TRYCATCH_VOID(Node*, propertyValue, V8Node::toNativeWithTypeCheck(info.Get
Isolate(), jsValue)); | 103 V8TRYCATCH_VOID(Node*, propertyValue, V8Node::toNativeWithTypeCheck(info.Get
Isolate(), v8Value)); |
| 104 if (!isUndefinedOrNull(jsValue) && !V8Node::hasInstance(jsValue, info.GetIso
late())) { | 104 if (!isUndefinedOrNull(v8Value) && !V8Node::hasInstance(v8Value, info.GetIso
late())) { |
| 105 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); | 105 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); |
| 106 exceptionState.throwIfNeeded(); | 106 exceptionState.throwIfNeeded(); |
| 107 return; | 107 return; |
| 108 } | 108 } |
| 109 bool result = impl->anonymousIndexedSetter(index, propertyValue); | 109 bool result = impl->anonymousIndexedSetter(index, propertyValue); |
| 110 if (!result) | 110 if (!result) |
| 111 return; | 111 return; |
| 112 v8SetReturnValue(info, jsValue); | 112 v8SetReturnValue(info, v8Value); |
| 113 } | 113 } |
| 114 | 114 |
| 115 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<v8::Value>& info) | 115 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 116 { | 116 { |
| 117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
| 118 TestEventTargetV8Internal::indexedPropertySetter(index, jsValue, info); | 118 TestEventTargetV8Internal::indexedPropertySetter(index, v8Value, info); |
| 119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 120 } | 120 } |
| 121 | 121 |
| 122 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) | 122 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) |
| 123 { | 123 { |
| 124 TestEventTarget* impl = V8TestEventTarget::toNative(info.Holder()); | 124 TestEventTarget* impl = V8TestEventTarget::toNative(info.Holder()); |
| 125 ExceptionState exceptionState(ExceptionState::IndexedDeletionContext, "TestE
ventTarget", info.Holder(), info.GetIsolate()); | 125 ExceptionState exceptionState(ExceptionState::IndexedDeletionContext, "TestE
ventTarget", info.Holder(), info.GetIsolate()); |
| 126 DeleteResult result = impl->anonymousIndexedDeleter(index, exceptionState); | 126 DeleteResult result = impl->anonymousIndexedDeleter(index, exceptionState); |
| 127 if (exceptionState.throwIfNeeded()) | 127 if (exceptionState.throwIfNeeded()) |
| 128 return; | 128 return; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 152 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); | 152 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); |
| 153 } | 153 } |
| 154 | 154 |
| 155 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 155 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
| 156 { | 156 { |
| 157 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 157 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| 158 TestEventTargetV8Internal::namedPropertyGetter(name, info); | 158 TestEventTargetV8Internal::namedPropertyGetter(name, info); |
| 159 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 159 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 160 } | 160 } |
| 161 | 161 |
| 162 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) | 162 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 163 { | 163 { |
| 164 if (info.Holder()->HasRealNamedProperty(name)) | 164 if (info.Holder()->HasRealNamedProperty(name)) |
| 165 return; | 165 return; |
| 166 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 166 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 167 return; | 167 return; |
| 168 | 168 |
| 169 TestEventTarget* impl = V8TestEventTarget::toNative(info.Holder()); | 169 TestEventTarget* impl = V8TestEventTarget::toNative(info.Holder()); |
| 170 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name)
; | 170 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name)
; |
| 171 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsVa
lue); | 171 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, v8Va
lue); |
| 172 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); | 172 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); |
| 173 if (!result) | 173 if (!result) |
| 174 return; | 174 return; |
| 175 v8SetReturnValue(info, jsValue); | 175 v8SetReturnValue(info, v8Value); |
| 176 } | 176 } |
| 177 | 177 |
| 178 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) | 178 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 179 { | 179 { |
| 180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| 181 TestEventTargetV8Internal::namedPropertySetter(name, jsValue, info); | 181 TestEventTargetV8Internal::namedPropertySetter(name, v8Value, info); |
| 182 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 182 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 183 } | 183 } |
| 184 | 184 |
| 185 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) | 185 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) |
| 186 { | 186 { |
| 187 TestEventTarget* impl = V8TestEventTarget::toNative(info.Holder()); | 187 TestEventTarget* impl = V8TestEventTarget::toNative(info.Holder()); |
| 188 AtomicString propertyName = toCoreAtomicString(name); | 188 AtomicString propertyName = toCoreAtomicString(name); |
| 189 v8::String::Utf8Value namedProperty(name); | 189 v8::String::Utf8Value namedProperty(name); |
| 190 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestEventTarget", info.Holder(), info.GetIsolate()); | 190 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestEventTarget", info.Holder(), info.GetIsolate()); |
| 191 bool result = impl->namedPropertyQuery(propertyName, exceptionState); | 191 bool result = impl->namedPropertyQuery(propertyName, exceptionState); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 if (!result.IsEmpty()) | 274 if (!result.IsEmpty()) |
| 275 return result; | 275 return result; |
| 276 | 276 |
| 277 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 277 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 278 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); | 278 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); |
| 279 configureV8TestEventTargetTemplate(result, isolate); | 279 configureV8TestEventTargetTemplate(result, isolate); |
| 280 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; | 280 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; |
| 281 return result; | 281 return result; |
| 282 } | 282 } |
| 283 | 283 |
| 284 bool V8TestEventTarget::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate*
isolate) | 284 bool V8TestEventTarget::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate*
isolate) |
| 285 { | 285 { |
| 286 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e); | 286 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
| 287 } | 287 } |
| 288 | 288 |
| 289 v8::Handle<v8::Object> V8TestEventTarget::findInstanceInPrototypeChain(v8::Handl
e<v8::Value> jsValue, v8::Isolate* isolate) | 289 v8::Handle<v8::Object> V8TestEventTarget::findInstanceInPrototypeChain(v8::Handl
e<v8::Value> v8Value, v8::Isolate* isolate) |
| 290 { | 290 { |
| 291 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, jsValue); | 291 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 292 } | 292 } |
| 293 | 293 |
| 294 TestEventTarget* V8TestEventTarget::toNativeWithTypeCheck(v8::Isolate* isolate,
v8::Handle<v8::Value> value) | 294 TestEventTarget* V8TestEventTarget::toNativeWithTypeCheck(v8::Isolate* isolate,
v8::Handle<v8::Value> value) |
| 295 { | 295 { |
| 296 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; | 296 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
| 297 } | 297 } |
| 298 | 298 |
| 299 EventTarget* V8TestEventTarget::toEventTarget(v8::Handle<v8::Object> object) | 299 EventTarget* V8TestEventTarget::toEventTarget(v8::Handle<v8::Object> object) |
| 300 { | 300 { |
| 301 return toNative(object); | 301 return toNative(object); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 326 fromInternalPointer(object)->deref(); | 326 fromInternalPointer(object)->deref(); |
| 327 } | 327 } |
| 328 | 328 |
| 329 template<> | 329 template<> |
| 330 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) | 330 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) |
| 331 { | 331 { |
| 332 return toV8(impl, creationContext, isolate); | 332 return toV8(impl, creationContext, isolate); |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace WebCore | 335 } // namespace WebCore |
| OLD | NEW |