Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Unified Diff: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 2321073002: binding: Let indexed interceptor falls through to named interceptor. (Closed)
Patch Set: Updated global-interface-listing expectations. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
index b73707f50a842f2b42c66b262ce769dc06df07ed..b6cbe103b98d2045b32dd4d381ef4b4d1016021b 100644
--- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
@@ -636,147 +636,151 @@ static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
TestInterface5ImplementationV8Internal::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)
{
TestInterface5Implementation* impl = V8TestInterface5::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)
{
- TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info);
+ if (!name->IsString())
+ return;
+ const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
+
+ TestInterface5ImplementationV8Internal::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)
{
TestInterface5Implementation* impl = V8TestInterface5::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)
{
- TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value, info);
+ if (!name->IsString())
+ return;
+ const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
+
+ TestInterface5ImplementationV8Internal::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)
{
TestInterface5Implementation* impl = V8TestInterface5::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)
{
- TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info);
+ if (!name->IsString())
+ return;
+ const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
+
+ TestInterface5ImplementationV8Internal::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, "TestInterface5", nameInUtf8.data());
+
TestInterface5Implementation* impl = V8TestInterface5::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;
- TestInterface5ImplementationV8Internal::namedPropertyGetter(name, info);
+ const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
+
+ TestInterface5ImplementationV8Internal::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, "TestInterface5");
+
TestInterface5Implementation* impl = V8TestInterface5::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;
- TestInterface5ImplementationV8Internal::namedPropertySetter(name, v8Value, info);
+ TestInterface5ImplementationV8Internal::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)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
- AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
- v8::String::Utf8Value namedProperty(name);
- ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface5", 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;
- TestInterface5ImplementationV8Internal::namedPropertyQuery(name, info);
+ TestInterface5ImplementationV8Internal::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)
{
TestInterface5Implementation* impl = V8TestInterface5::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;
- TestInterface5ImplementationV8Internal::namedPropertyDeleter(name, info);
+ TestInterface5ImplementationV8Internal::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)
{
TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
- Vector<String> names;
- ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInterface5", 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)
{
- TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info);
+ TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info);
}
} // namespace TestInterface5ImplementationV8Internal

Powered by Google App Engine
This is Rietveld 408576698