| 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 "V8TestSpecialOperations.h" | 7 #include "V8TestSpecialOperations.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/NodeOrNodeList.h" | 10 #include "bindings/core/v8/NodeOrNodeList.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 98 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 99 { | 99 { |
| 100 auto nameString = name.As<v8::String>(); | 100 auto nameString = name.As<v8::String>(); |
| 101 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; | 101 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; |
| 102 V8StringResource<> propertyName(nameString); | 102 V8StringResource<> propertyName(nameString); |
| 103 if (!propertyName.prepare()) | 103 if (!propertyName.prepare()) |
| 104 return; | 104 return; |
| 105 Node* propertyValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value
); | 105 Node* propertyValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value
); |
| 106 if (!propertyValue && !isUndefinedOrNull(v8Value)) { | 106 if (!propertyValue && !isUndefinedOrNull(v8Value)) { |
| 107 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); | 107 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); |
| 108 exceptionState.throwIfNeeded(); | |
| 109 return; | 108 return; |
| 110 } | 109 } |
| 111 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); | 110 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); |
| 112 if (!result) | 111 if (!result) |
| 113 return; | 112 return; |
| 114 v8SetReturnValue(info, v8Value); | 113 v8SetReturnValue(info, v8Value); |
| 115 } | 114 } |
| 116 | 115 |
| 117 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 116 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 118 { | 117 { |
| 119 if (!name->IsString()) | 118 if (!name->IsString()) |
| 120 return; | 119 return; |
| 121 TestSpecialOperationsV8Internal::namedPropertySetter(name, v8Value, info); | 120 TestSpecialOperationsV8Internal::namedPropertySetter(name, v8Value, info); |
| 122 } | 121 } |
| 123 | 122 |
| 124 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) | 123 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ackInfo<v8::Integer>& info) |
| 125 { | 124 { |
| 126 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; | 125 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; |
| 127 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); | 126 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 128 v8::String::Utf8Value namedProperty(name); | 127 v8::String::Utf8Value namedProperty(name); |
| 129 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestSpecialOperations", info.Holder(), info.GetIsolate()); | 128 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestSpecialOperations", info.Holder(), info.GetIsolate()); |
| 130 bool result = impl->namedPropertyQuery(propertyName, exceptionState); | 129 bool result = impl->namedPropertyQuery(propertyName, exceptionState); |
| 131 if (exceptionState.throwIfNeeded()) | 130 if (exceptionState.hadException()) |
| 132 return; | 131 return; |
| 133 if (!result) | 132 if (!result) |
| 134 return; | 133 return; |
| 135 v8SetReturnValueInt(info, v8::None); | 134 v8SetReturnValueInt(info, v8::None); |
| 136 } | 135 } |
| 137 | 136 |
| 138 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) | 137 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) |
| 139 { | 138 { |
| 140 if (!name->IsString()) | 139 if (!name->IsString()) |
| 141 return; | 140 return; |
| 142 TestSpecialOperationsV8Internal::namedPropertyQuery(name, info); | 141 TestSpecialOperationsV8Internal::namedPropertyQuery(name, info); |
| 143 } | 142 } |
| 144 | 143 |
| 145 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | 144 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
| 146 { | 145 { |
| 147 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; | 146 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder())
; |
| 148 Vector<String> names; | 147 Vector<String> names; |
| 149 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestSpeci
alOperations", info.Holder(), info.GetIsolate()); | 148 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestSpeci
alOperations", info.Holder(), info.GetIsolate()); |
| 150 impl->namedPropertyEnumerator(names, exceptionState); | 149 impl->namedPropertyEnumerator(names, exceptionState); |
| 151 if (exceptionState.throwIfNeeded()) | 150 if (exceptionState.hadException()) |
| 152 return; | 151 return; |
| 153 v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size(
)); | 152 v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size(
)); |
| 154 for (size_t i = 0; i < names.size(); ++i) { | 153 for (size_t i = 0; i < names.size(); ++i) { |
| 155 if (!v8CallBoolean(v8names->CreateDataProperty(info.GetIsolate()->GetCur
rentContext(), i, v8String(info.GetIsolate(), names[i])))) | 154 if (!v8CallBoolean(v8names->CreateDataProperty(info.GetIsolate()->GetCur
rentContext(), i, v8String(info.GetIsolate(), names[i])))) |
| 156 return; | 155 return; |
| 157 } | 156 } |
| 158 v8SetReturnValue(info, v8names); | 157 v8SetReturnValue(info, v8names); |
| 159 } | 158 } |
| 160 | 159 |
| 161 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 160 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 { | 199 { |
| 201 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 200 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 202 } | 201 } |
| 203 | 202 |
| 204 TestSpecialOperations* V8TestSpecialOperations::toImplWithTypeCheck(v8::Isolate*
isolate, v8::Local<v8::Value> value) | 203 TestSpecialOperations* V8TestSpecialOperations::toImplWithTypeCheck(v8::Isolate*
isolate, v8::Local<v8::Value> value) |
| 205 { | 204 { |
| 206 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 205 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
| 207 } | 206 } |
| 208 | 207 |
| 209 } // namespace blink | 208 } // namespace blink |
| OLD | NEW |