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

Unified Diff: Source/bindings/tests/results/core/V8TestInterface2.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/V8TestInterface2.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterface2.cpp b/Source/bindings/tests/results/core/V8TestInterface2.cpp
index 51dd332ad86dd9c50537a91962b9a0d00b4738b0..1e6ae21acd9e8fdac72b9774680f1265c0a2f88f 100644
--- a/Source/bindings/tests/results/core/V8TestInterface2.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterface2.cpp
@@ -472,16 +472,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;
-
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(nameString);
v8::String::Utf8Value namedProperty(nameString);
@@ -503,16 +494,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;
-
v8::String::Utf8Value namedProperty(nameString);
ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate());
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
@@ -542,8 +524,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;
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
v8::String::Utf8Value namedProperty(name);
@@ -565,8 +545,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;
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
v8::String::Utf8Value namedProperty(name);
@@ -678,6 +656,8 @@ static void installV8TestInterface2Template(v8::Local<v8::FunctionTemplate> func
}
{
v8::NamedPropertyHandlerConfiguration config(TestInterface2V8Internal::namedPropertyGetterCallback, TestInterface2V8Internal::namedPropertySetterCallback, TestInterface2V8Internal::namedPropertyQueryCallback, TestInterface2V8Internal::namedPropertyDeleterCallback, TestInterface2V8Internal::namedPropertyEnumeratorCallback);
+ config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(config.flags) | static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStrings));
+ 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, TestInterface2V8Internal::iteratorMethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts };
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterface.cpp ('k') | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698