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

Unified Diff: Source/bindings/tests/results/core/V8TestInterface.cpp

Issue 1019773006: use non-masking, string interceptors in generated bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test Created 5 years, 9 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: Source/bindings/tests/results/core/V8TestInterface.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterface.cpp b/Source/bindings/tests/results/core/V8TestInterface.cpp
index fe751e40ec0a26e318f3c4262bf57dd2aa6f26f7..d67f1284b627985b322d248fab9dfb21ade96031 100644
--- a/Source/bindings/tests/results/core/V8TestInterface.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -2016,16 +2016,7 @@ static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
- if (!name->IsString())
- return;
auto nameString = name.As<v8::String>();
- v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
- if (v8CallBoolean(info.Holder()->HasRealNamedProperty(context, nameString)))
- return;
- v8::Local<v8::Value> namedPropertyValue;
- if (info.Holder()->GetRealNamedPropertyInPrototypeChain(context, nameString).ToLocal(&namedPropertyValue))
- return;
-
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(nameString);
String result = impl->anonymousNamedGetter(propertyName);
@@ -2043,16 +2034,7 @@ static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
{
- if (!name->IsString())
- return;
auto nameString = name.As<v8::String>();
- v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
- if (v8CallBoolean(info.Holder()->HasRealNamedProperty(context, nameString)))
- return;
- v8::Local<v8::Value> namedPropertyValue;
- if (info.Holder()->GetRealNamedPropertyInPrototypeChain(context, nameString).ToLocal(&namedPropertyValue))
- return;
-
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
V8StringResource<> propertyName(nameString);
if (!propertyName.prepare())
@@ -2075,8 +2057,6 @@ static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
- if (!name->IsString())
- return;
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
v8::String::Utf8Value namedProperty(name);
@@ -2098,8 +2078,6 @@ static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
{
- if (!name->IsString())
- return;
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
DeleteResult result = impl->anonymousNamedDeleter(propertyName);
@@ -2261,7 +2239,9 @@ void V8TestInterface::installV8TestInterfaceTemplate(v8::Local<v8::FunctionTempl
}
{
v8::NamedPropertyHandlerConfiguration config(TestInterfaceImplementationV8Internal::namedPropertyGetterCallback, TestInterfaceImplementationV8Internal::namedPropertySetterCallback, TestInterfaceImplementationV8Internal::namedPropertyQueryCallback, TestInterfaceImplementationV8Internal::namedPropertyDeleterCallback, TestInterfaceImplementationV8Internal::namedPropertyEnumeratorCallback);
+ config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(config.flags) | static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStrings));
config.flags = v8::PropertyHandlerFlags::kAllCanRead;
+ config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(config.flags) | static_cast<int>(v8::PropertyHandlerFlags::kNonMasking));
functionTemplate->InstanceTemplate()->SetHandler(config);
}
static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, TestInterfaceImplementationV8Internal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts };
« no previous file with comments | « Source/bindings/templates/interface_base.cpp ('k') | Source/bindings/tests/results/core/V8TestInterface2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698