| Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
|
| index 1e61a70d980667bfc3f297c2a34ee198ca3b6201..04e2e4429a9ca97e997e3d2041b4e720cef3e53d 100644
|
| --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
|
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
|
| @@ -2379,147 +2379,151 @@ static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
|
| TestInterfaceImplementationV8Internal::iteratorMethod(info);
|
| }
|
|
|
| -static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| {
|
| TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
|
| - String result = impl->anonymousIndexedGetter(index);
|
| + String result = impl->anonymousNamedGetter(name);
|
| if (result.isNull())
|
| return;
|
| v8SetReturnValueString(info, result, info.GetIsolate());
|
| }
|
|
|
| -void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| {
|
| - TestInterfaceImplementationV8Internal::indexedPropertyGetter(index, info);
|
| + if (!name->IsString())
|
| + return;
|
| + const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
|
| +
|
| + TestInterfaceImplementationV8Internal::namedPropertyGetter(propertyName, info);
|
| }
|
|
|
| -static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| {
|
| TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
|
| V8StringResource<> propertyValue = v8Value;
|
| if (!propertyValue.prepare())
|
| return;
|
| - bool result = impl->anonymousIndexedSetter(index, propertyValue);
|
| +
|
| + bool result = impl->anonymousNamedSetter(name, propertyValue);
|
| if (!result)
|
| return;
|
| v8SetReturnValue(info, v8Value);
|
| }
|
|
|
| -void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| {
|
| - TestInterfaceImplementationV8Internal::indexedPropertySetter(index, v8Value, info);
|
| + if (!name->IsString())
|
| + return;
|
| + const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
|
| +
|
| + TestInterfaceImplementationV8Internal::namedPropertySetter(propertyName, v8Value, info);
|
| }
|
|
|
| -static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
|
| +static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
|
| {
|
| TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
|
| - DeleteResult result = impl->anonymousIndexedDeleter(index);
|
| - if (result != DeleteUnknownProperty)
|
| - return v8SetReturnValueBool(info, result == DeleteSuccess);
|
| +
|
| + DeleteResult result = impl->anonymousNamedDeleter(name);
|
| + if (result == DeleteUnknownProperty)
|
| + return;
|
| + v8SetReturnValue(info, result == DeleteSuccess);
|
| }
|
|
|
| -void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
|
| +void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
|
| {
|
| - TestInterfaceImplementationV8Internal::indexedPropertyDeleter(index, info);
|
| + if (!name->IsString())
|
| + return;
|
| + const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
|
| +
|
| + TestInterfaceImplementationV8Internal::namedPropertyDeleter(propertyName, info);
|
| }
|
|
|
| -static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Integer>& info)
|
| {
|
| - auto nameString = name.As<v8::String>();
|
| + const CString& nameInUtf8 = name.utf8();
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "TestInterface", nameInUtf8.data());
|
| +
|
| TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
|
| - AtomicString propertyName = toCoreAtomicString(nameString);
|
| - String result = impl->anonymousNamedGetter(propertyName);
|
| - if (result.isNull())
|
| +
|
| + bool result = impl->namedPropertyQuery(name, exceptionState);
|
| + if (!result)
|
| return;
|
| - v8SetReturnValueString(info, result, info.GetIsolate());
|
| + v8SetReturnValueInt(info, v8::None);
|
| }
|
|
|
| -void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
|
| {
|
| if (!name->IsString())
|
| return;
|
| - TestInterfaceImplementationV8Internal::namedPropertyGetter(name, info);
|
| + const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
|
| +
|
| + TestInterfaceImplementationV8Internal::namedPropertyQuery(propertyName, info);
|
| }
|
|
|
| -static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
|
| {
|
| - auto nameString = name.As<v8::String>();
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::EnumerationContext, "TestInterface");
|
| +
|
| TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
|
| - V8StringResource<> propertyName(nameString);
|
| - if (!propertyName.prepare())
|
| - return;
|
| - V8StringResource<> propertyValue = v8Value;
|
| - if (!propertyValue.prepare())
|
| - return;
|
| - bool result = impl->anonymousNamedSetter(propertyName, propertyValue);
|
| - if (!result)
|
| +
|
| + Vector<String> names;
|
| + impl->namedPropertyEnumerator(names, exceptionState);
|
| + if (exceptionState.hadException())
|
| return;
|
| - v8SetReturnValue(info, v8Value);
|
| + v8SetReturnValue(info, toV8(names, info.Holder(), info.GetIsolate()).As<v8::Array>());
|
| }
|
|
|
| -void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| +void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
|
| {
|
| - if (!name->IsString())
|
| - return;
|
| - TestInterfaceImplementationV8Internal::namedPropertySetter(name, v8Value, info);
|
| + TestInterfaceImplementationV8Internal::namedPropertyEnumerator(info);
|
| }
|
|
|
| -static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
|
| +static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| {
|
| TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
|
| - AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
|
| - v8::String::Utf8Value namedProperty(name);
|
| - ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface", info.Holder(), info.GetIsolate());
|
| - bool result = impl->namedPropertyQuery(propertyName, exceptionState);
|
| - if (exceptionState.hadException())
|
| - return;
|
| - if (!result)
|
| +
|
| + String result = impl->anonymousIndexedGetter(index);
|
| + if (result.isNull())
|
| return;
|
| - v8SetReturnValueInt(info, v8::None);
|
| + v8SetReturnValueString(info, result, info.GetIsolate());
|
| }
|
|
|
| -void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
|
| +void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| {
|
| - if (!name->IsString())
|
| - return;
|
| - TestInterfaceImplementationV8Internal::namedPropertyQuery(name, info);
|
| + TestInterfaceImplementationV8Internal::indexedPropertyGetter(index, info);
|
| }
|
|
|
| -static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
|
| +static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| {
|
| TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
|
| - AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
|
| - DeleteResult result = impl->anonymousNamedDeleter(propertyName);
|
| - if (result != DeleteUnknownProperty)
|
| - return v8SetReturnValueBool(info, result == DeleteSuccess);
|
| + V8StringResource<> propertyValue = v8Value;
|
| + if (!propertyValue.prepare())
|
| + return;
|
| +
|
| + bool result = impl->anonymousIndexedSetter(index, propertyValue);
|
| + if (!result)
|
| + return;
|
| + v8SetReturnValue(info, v8Value);
|
| }
|
|
|
| -void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
|
| +void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
|
| {
|
| - if (!name->IsString())
|
| - return;
|
| - TestInterfaceImplementationV8Internal::namedPropertyDeleter(name, info);
|
| + TestInterfaceImplementationV8Internal::indexedPropertySetter(index, v8Value, info);
|
| }
|
|
|
| -static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
|
| +static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
|
| {
|
| TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
|
| - Vector<String> names;
|
| - ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInterface", info.Holder(), info.GetIsolate());
|
| - impl->namedPropertyEnumerator(names, exceptionState);
|
| - if (exceptionState.hadException())
|
| +
|
| + DeleteResult result = impl->anonymousIndexedDeleter(index);
|
| + if (result == DeleteUnknownProperty)
|
| return;
|
| - v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
|
| - for (size_t i = 0; i < names.size(); ++i) {
|
| - if (!v8CallBoolean(v8names->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), i, v8String(info.GetIsolate(), names[i]))))
|
| - return;
|
| - }
|
| - v8SetReturnValue(info, v8names);
|
| + v8SetReturnValue(info, result == DeleteSuccess);
|
| }
|
|
|
| -void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
|
| +void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
|
| {
|
| - TestInterfaceImplementationV8Internal::namedPropertyEnumerator(info);
|
| + TestInterfaceImplementationV8Internal::indexedPropertyDeleter(index, info);
|
| }
|
|
|
| } // namespace TestInterfaceImplementationV8Internal
|
|
|