| 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 "V8TestSpecialOperations.h" | 8 #include "V8TestSpecialOperations.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 namespace TestSpecialOperationsV8Internal { | 50 namespace TestSpecialOperationsV8Internal { |
| 51 | 51 |
| 52 template <typename T> void V8_USE(T) { } | 52 template <typename T> void V8_USE(T) { } |
| 53 | 53 |
| 54 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 54 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 55 { | 55 { |
| 56 if (UNLIKELY(info.Length() < 1)) { | 56 if (UNLIKELY(info.Length() < 1)) { |
| 57 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("n
amedItem", "TestSpecialOperations", 1, info.Length(), info.GetIsolate()), info.G
etIsolate()); | 57 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("n
amedItem", "TestSpecialOperations", 1, info.Length(), info.GetIsolate()), info.G
etIsolate()); |
| 58 return; | 58 return; |
| 59 } | 59 } |
| 60 TestSpecialOperations* impl = V8TestSpecialOperations::toNative(info.Holder(
)); | 60 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; |
| 61 V8StringResource<> name; | 61 V8StringResource<> name; |
| 62 { | 62 { |
| 63 TOSTRING_VOID_INTERNAL(name, info[0]); | 63 TOSTRING_VOID_INTERNAL(name, info[0]); |
| 64 } | 64 } |
| 65 RefPtrWillBeRawPtr<Node> result0 = nullptr; | 65 RefPtrWillBeRawPtr<Node> result0 = nullptr; |
| 66 RefPtrWillBeRawPtr<NodeList> result1 = nullptr; | 66 RefPtrWillBeRawPtr<NodeList> result1 = nullptr; |
| 67 impl->getItem(name, result0, result1); | 67 impl->getItem(name, result0, result1); |
| 68 if (result0) { | 68 if (result0) { |
| 69 v8SetReturnValue(info, result0.release()); | 69 v8SetReturnValue(info, result0.release()); |
| 70 return; | 70 return; |
| 71 } | 71 } |
| 72 if (result1) { | 72 if (result1) { |
| 73 v8SetReturnValue(info, result1.release()); | 73 v8SetReturnValue(info, result1.release()); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 v8SetReturnValueNull(info); | 76 v8SetReturnValueNull(info); |
| 77 } | 77 } |
| 78 | 78 |
| 79 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 79 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 80 { | 80 { |
| 81 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 81 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 82 TestSpecialOperationsV8Internal::namedItemMethod(info); | 82 TestSpecialOperationsV8Internal::namedItemMethod(info); |
| 83 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 83 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 84 } | 84 } |
| 85 | 85 |
| 86 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 86 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
| 87 { | 87 { |
| 88 TestSpecialOperations* impl = V8TestSpecialOperations::toNative(info.Holder(
)); | 88 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; |
| 89 AtomicString propertyName = toCoreAtomicString(name); | 89 AtomicString propertyName = toCoreAtomicString(name); |
| 90 RefPtrWillBeRawPtr<Node> result0 = nullptr; | 90 RefPtrWillBeRawPtr<Node> result0 = nullptr; |
| 91 RefPtrWillBeRawPtr<NodeList> result1 = nullptr; | 91 RefPtrWillBeRawPtr<NodeList> result1 = nullptr; |
| 92 impl->getItem(propertyName, result0, result1); | 92 impl->getItem(propertyName, result0, result1); |
| 93 if (!(result0 || result1)) | 93 if (!(result0 || result1)) |
| 94 return; | 94 return; |
| 95 if (result0) { | 95 if (result0) { |
| 96 v8SetReturnValue(info, result0.release()); | 96 v8SetReturnValue(info, result0.release()); |
| 97 return; | 97 return; |
| 98 } | 98 } |
| 99 if (result1) { | 99 if (result1) { |
| 100 v8SetReturnValue(info, result1.release()); | 100 v8SetReturnValue(info, result1.release()); |
| 101 return; | 101 return; |
| 102 } | 102 } |
| 103 ASSERT_NOT_REACHED(); | 103 ASSERT_NOT_REACHED(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 106 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
| 107 { | 107 { |
| 108 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | 108 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
| 109 TestSpecialOperationsV8Internal::namedPropertyGetter(name, info); | 109 TestSpecialOperationsV8Internal::namedPropertyGetter(name, info); |
| 110 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 110 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 111 } | 111 } |
| 112 | 112 |
| 113 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 113 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 114 { | 114 { |
| 115 TestSpecialOperations* impl = V8TestSpecialOperations::toNative(info.Holder(
)); | 115 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; |
| 116 TOSTRING_VOID(V8StringResource<>, propertyName, name); | 116 TOSTRING_VOID(V8StringResource<>, propertyName, name); |
| 117 TONATIVE_VOID(Node*, propertyValue, V8Node::toNativeWithTypeCheck(info.GetIs
olate(), v8Value)); | 117 TONATIVE_VOID(Node*, propertyValue, V8Node::toImplWithTypeCheck(info.GetIsol
ate(), v8Value)); |
| 118 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); | 118 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); |
| 119 if (!result) | 119 if (!result) |
| 120 return; | 120 return; |
| 121 v8SetReturnValue(info, v8Value); | 121 v8SetReturnValue(info, v8Value); |
| 122 } | 122 } |
| 123 | 123 |
| 124 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 124 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 125 { | 125 { |
| 126 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | 126 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
| 127 TestSpecialOperationsV8Internal::namedPropertySetter(name, v8Value, info); | 127 TestSpecialOperationsV8Internal::namedPropertySetter(name, v8Value, info); |
| 128 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 128 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 129 } | 129 } |
| 130 | 130 |
| 131 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) | 131 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) |
| 132 { | 132 { |
| 133 TestSpecialOperations* impl = V8TestSpecialOperations::toNative(info.Holder(
)); | 133 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; |
| 134 AtomicString propertyName = toCoreAtomicString(name); | 134 AtomicString propertyName = toCoreAtomicString(name); |
| 135 v8::String::Utf8Value namedProperty(name); | 135 v8::String::Utf8Value namedProperty(name); |
| 136 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestSpecialOperations", info.Holder(), info.GetIsolate()); | 136 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestSpecialOperations", info.Holder(), info.GetIsolate()); |
| 137 bool result = impl->namedPropertyQuery(propertyName, exceptionState); | 137 bool result = impl->namedPropertyQuery(propertyName, exceptionState); |
| 138 if (exceptionState.throwIfNeeded()) | 138 if (exceptionState.throwIfNeeded()) |
| 139 return; | 139 return; |
| 140 if (!result) | 140 if (!result) |
| 141 return; | 141 return; |
| 142 v8SetReturnValueInt(info, v8::None); | 142 v8SetReturnValueInt(info, v8::None); |
| 143 } | 143 } |
| 144 | 144 |
| 145 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) | 145 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) |
| 146 { | 146 { |
| 147 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | 147 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
| 148 TestSpecialOperationsV8Internal::namedPropertyQuery(name, info); | 148 TestSpecialOperationsV8Internal::namedPropertyQuery(name, info); |
| 149 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 149 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 150 } | 150 } |
| 151 | 151 |
| 152 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | 152 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
| 153 { | 153 { |
| 154 TestSpecialOperations* impl = V8TestSpecialOperations::toNative(info.Holder(
)); | 154 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; |
| 155 Vector<String> names; | 155 Vector<String> names; |
| 156 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestSpeci
alOperations", info.Holder(), info.GetIsolate()); | 156 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestSpeci
alOperations", info.Holder(), info.GetIsolate()); |
| 157 impl->namedPropertyEnumerator(names, exceptionState); | 157 impl->namedPropertyEnumerator(names, exceptionState); |
| 158 if (exceptionState.throwIfNeeded()) | 158 if (exceptionState.throwIfNeeded()) |
| 159 return; | 159 return; |
| 160 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size
()); | 160 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size
()); |
| 161 for (size_t i = 0; i < names.size(); ++i) | 161 for (size_t i = 0; i < names.size(); ++i) |
| 162 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs
olate(), names[i])); | 162 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs
olate(), names[i])); |
| 163 v8SetReturnValue(info, v8names); | 163 v8SetReturnValue(info, v8names); |
| 164 } | 164 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 bool V8TestSpecialOperations::hasInstance(v8::Handle<v8::Value> v8Value, v8::Iso
late* isolate) | 202 bool V8TestSpecialOperations::hasInstance(v8::Handle<v8::Value> v8Value, v8::Iso
late* isolate) |
| 203 { | 203 { |
| 204 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | 204 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
| 205 } | 205 } |
| 206 | 206 |
| 207 v8::Handle<v8::Object> V8TestSpecialOperations::findInstanceInPrototypeChain(v8:
:Handle<v8::Value> v8Value, v8::Isolate* isolate) | 207 v8::Handle<v8::Object> V8TestSpecialOperations::findInstanceInPrototypeChain(v8:
:Handle<v8::Value> v8Value, v8::Isolate* isolate) |
| 208 { | 208 { |
| 209 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 209 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 210 } | 210 } |
| 211 | 211 |
| 212 TestSpecialOperations* V8TestSpecialOperations::toNativeWithTypeCheck(v8::Isolat
e* isolate, v8::Handle<v8::Value> value) | 212 TestSpecialOperations* V8TestSpecialOperations::toImplWithTypeCheck(v8::Isolate*
isolate, v8::Handle<v8::Value> value) |
| 213 { | 213 { |
| 214 return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPo
inter(v8::Handle<v8::Object>::Cast(value))) : 0; | 214 return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle
<v8::Object>::Cast(value))->toImpl<TestSpecialOperations>() : 0; |
| 215 } | 215 } |
| 216 | 216 |
| 217 | 217 |
| 218 void V8TestSpecialOperations::refObject(ScriptWrappableBase* internalPointer) | 218 void V8TestSpecialOperations::refObject(ScriptWrappableBase* internalPointer) |
| 219 { | 219 { |
| 220 fromInternalPointer(internalPointer)->ref(); | 220 internalPointer->toImpl<TestSpecialOperations>()->ref(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void V8TestSpecialOperations::derefObject(ScriptWrappableBase* internalPointer) | 223 void V8TestSpecialOperations::derefObject(ScriptWrappableBase* internalPointer) |
| 224 { | 224 { |
| 225 fromInternalPointer(internalPointer)->deref(); | 225 internalPointer->toImpl<TestSpecialOperations>()->deref(); |
| 226 } | 226 } |
| 227 | 227 |
| 228 WrapperPersistentNode* V8TestSpecialOperations::createPersistentHandle(ScriptWra
ppableBase* internalPointer) | 228 WrapperPersistentNode* V8TestSpecialOperations::createPersistentHandle(ScriptWra
ppableBase* internalPointer) |
| 229 { | 229 { |
| 230 ASSERT_NOT_REACHED(); | 230 ASSERT_NOT_REACHED(); |
| 231 return 0; | 231 return 0; |
| 232 } | 232 } |
| 233 | 233 |
| 234 template<> | 234 template<> |
| 235 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperations* impl, v8::Handle<v8::O
bject> creationContext, v8::Isolate* isolate) | 235 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperations* impl, v8::Handle<v8::O
bject> creationContext, v8::Isolate* isolate) |
| 236 { | 236 { |
| 237 return toV8(impl, creationContext, isolate); | 237 return toV8(impl, creationContext, isolate); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace blink | 240 } // namespace blink |
| OLD | NEW |