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

Side by Side Diff: Source/bindings/tests/results/core/V8TestObject.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, 8 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 unified diff | Download patch
OLDNEW
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 "config.h" 7 #include "config.h"
8 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 11990 matching lines...) Expand 10 before | Expand all | Expand 10 after
12001 12001
12002 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal lbackInfo<v8::Boolean>& info) 12002 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal lbackInfo<v8::Boolean>& info)
12003 { 12003 {
12004 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); 12004 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty");
12005 TestObjectV8Internal::indexedPropertyDeleter(index, info); 12005 TestObjectV8Internal::indexedPropertyDeleter(index, info);
12006 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 12006 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
12007 } 12007 }
12008 12008
12009 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info) 12009 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info)
12010 { 12010 {
12011 if (!name->IsString())
12012 return;
12013 auto nameString = name.As<v8::String>(); 12011 auto nameString = name.As<v8::String>();
12014 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
12015 if (v8CallBoolean(info.Holder()->HasRealNamedProperty(context, nameString)))
12016 return;
12017 v8::Local<v8::Value> namedPropertyValue;
12018 if (info.Holder()->GetRealNamedPropertyInPrototypeChain(context, nameString) .ToLocal(&namedPropertyValue))
12019 return;
12020
12021 TestObject* impl = V8TestObject::toImpl(info.Holder()); 12012 TestObject* impl = V8TestObject::toImpl(info.Holder());
12022 AtomicString propertyName = toCoreAtomicString(nameString); 12013 AtomicString propertyName = toCoreAtomicString(nameString);
12023 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 12014 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
12024 ScriptValue result = impl->anonymousNamedGetter(scriptState, propertyName); 12015 ScriptValue result = impl->anonymousNamedGetter(scriptState, propertyName);
12025 if (result.isEmpty()) 12016 if (result.isEmpty())
12026 return; 12017 return;
12027 v8SetReturnValue(info, result.v8Value()); 12018 v8SetReturnValue(info, result.v8Value());
12028 } 12019 }
12029 12020
12030 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop ertyCallbackInfo<v8::Value>& info) 12021 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop ertyCallbackInfo<v8::Value>& info)
12031 { 12022 {
12032 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); 12023 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
12033 TestObjectV8Internal::namedPropertyGetter(name, info); 12024 TestObjectV8Internal::namedPropertyGetter(name, info);
12034 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 12025 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
12035 } 12026 }
12036 12027
12037 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 12028 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
12038 { 12029 {
12039 if (!name->IsString())
12040 return;
12041 auto nameString = name.As<v8::String>(); 12030 auto nameString = name.As<v8::String>();
12042 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
12043 if (v8CallBoolean(info.Holder()->HasRealNamedProperty(context, nameString)))
12044 return;
12045 v8::Local<v8::Value> namedPropertyValue;
12046 if (info.Holder()->GetRealNamedPropertyInPrototypeChain(context, nameString) .ToLocal(&namedPropertyValue))
12047 return;
12048
12049 TestObject* impl = V8TestObject::toImpl(info.Holder()); 12031 TestObject* impl = V8TestObject::toImpl(info.Holder());
12050 V8StringResource<> propertyName(nameString); 12032 V8StringResource<> propertyName(nameString);
12051 if (!propertyName.prepare()) 12033 if (!propertyName.prepare())
12052 return; 12034 return;
12053 V8StringResource<> propertyValue = v8Value; 12035 V8StringResource<> propertyValue = v8Value;
12054 if (!propertyValue.prepare()) 12036 if (!propertyValue.prepare())
12055 return; 12037 return;
12056 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 12038 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
12057 bool result = impl->anonymousNamedSetter(scriptState, propertyName, property Value); 12039 bool result = impl->anonymousNamedSetter(scriptState, propertyName, property Value);
12058 if (!result) 12040 if (!result)
12059 return; 12041 return;
12060 v8SetReturnValue(info, v8Value); 12042 v8SetReturnValue(info, v8Value);
12061 } 12043 }
12062 12044
12063 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8:: Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 12045 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8:: Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
12064 { 12046 {
12065 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); 12047 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
12066 TestObjectV8Internal::namedPropertySetter(name, v8Value, info); 12048 TestObjectV8Internal::namedPropertySetter(name, v8Value, info);
12067 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 12049 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
12068 } 12050 }
12069 12051
12070 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb ackInfo<v8::Integer>& info) 12052 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb ackInfo<v8::Integer>& info)
12071 { 12053 {
12072 if (!name->IsString())
12073 return;
12074 TestObject* impl = V8TestObject::toImpl(info.Holder()); 12054 TestObject* impl = V8TestObject::toImpl(info.Holder());
12075 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); 12055 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
12076 v8::String::Utf8Value namedProperty(name); 12056 v8::String::Utf8Value namedProperty(name);
12077 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestObject", info.Holder(), info.GetIsolate()); 12057 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestObject", info.Holder(), info.GetIsolate());
12078 bool result = impl->namedPropertyQuery(propertyName, exceptionState); 12058 bool result = impl->namedPropertyQuery(propertyName, exceptionState);
12079 if (exceptionState.throwIfNeeded()) 12059 if (exceptionState.throwIfNeeded())
12080 return; 12060 return;
12081 if (!result) 12061 if (!result)
12082 return; 12062 return;
12083 v8SetReturnValueInt(info, v8::None); 12063 v8SetReturnValueInt(info, v8::None);
12084 } 12064 }
12085 12065
12086 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope rtyCallbackInfo<v8::Integer>& info) 12066 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope rtyCallbackInfo<v8::Integer>& info)
12087 { 12067 {
12088 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); 12068 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
12089 TestObjectV8Internal::namedPropertyQuery(name, info); 12069 TestObjectV8Internal::namedPropertyQuery(name, info);
12090 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 12070 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
12091 } 12071 }
12092 12072
12093 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal lbackInfo<v8::Boolean>& info) 12073 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal lbackInfo<v8::Boolean>& info)
12094 { 12074 {
12095 if (!name->IsString())
12096 return;
12097 TestObject* impl = V8TestObject::toImpl(info.Holder()); 12075 TestObject* impl = V8TestObject::toImpl(info.Holder());
12098 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); 12076 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
12099 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 12077 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
12100 DeleteResult result = impl->anonymousNamedDeleter(scriptState, propertyName) ; 12078 DeleteResult result = impl->anonymousNamedDeleter(scriptState, propertyName) ;
12101 if (result != DeleteUnknownProperty) 12079 if (result != DeleteUnknownProperty)
12102 return v8SetReturnValueBool(info, result == DeleteSuccess); 12080 return v8SetReturnValueBool(info, result == DeleteSuccess);
12103 } 12081 }
12104 12082
12105 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro pertyCallbackInfo<v8::Boolean>& info) 12083 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro pertyCallbackInfo<v8::Boolean>& info)
12106 { 12084 {
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
12623 static_assert(1 == TestObject::DEPRECATED_CONSTANT, "the value of TestObject _DEPRECATED_CONSTANT does not match with implementation"); 12601 static_assert(1 == TestObject::DEPRECATED_CONSTANT, "the value of TestObject _DEPRECATED_CONSTANT does not match with implementation");
12624 static_assert(1 == TestObject::MEASURED_CONSTANT, "the value of TestObject_M EASURED_CONSTANT does not match with implementation"); 12602 static_assert(1 == TestObject::MEASURED_CONSTANT, "the value of TestObject_M EASURED_CONSTANT does not match with implementation");
12625 static_assert(1 == TestObject::FEATURE_ENABLED_CONST, "the value of TestObje ct_FEATURE_ENABLED_CONST does not match with implementation"); 12603 static_assert(1 == TestObject::FEATURE_ENABLED_CONST, "the value of TestObje ct_FEATURE_ENABLED_CONST does not match with implementation");
12626 static_assert(1 == TestObject::CONST_IMPL, "the value of TestObject_CONST_IM PL does not match with implementation"); 12604 static_assert(1 == TestObject::CONST_IMPL, "the value of TestObject_CONST_IM PL does not match with implementation");
12627 { 12605 {
12628 v8::IndexedPropertyHandlerConfiguration config(TestObjectV8Internal::ind exedPropertyGetterCallback, TestObjectV8Internal::indexedPropertySetterCallback, 0, TestObjectV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumera tor<TestObject>); 12606 v8::IndexedPropertyHandlerConfiguration config(TestObjectV8Internal::ind exedPropertyGetterCallback, TestObjectV8Internal::indexedPropertySetterCallback, 0, TestObjectV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumera tor<TestObject>);
12629 functionTemplate->InstanceTemplate()->SetHandler(config); 12607 functionTemplate->InstanceTemplate()->SetHandler(config);
12630 } 12608 }
12631 { 12609 {
12632 v8::NamedPropertyHandlerConfiguration config(TestObjectV8Internal::named PropertyGetterCallback, TestObjectV8Internal::namedPropertySetterCallback, TestO bjectV8Internal::namedPropertyQueryCallback, TestObjectV8Internal::namedProperty DeleterCallback, TestObjectV8Internal::namedPropertyEnumeratorCallback); 12610 v8::NamedPropertyHandlerConfiguration config(TestObjectV8Internal::named PropertyGetterCallback, TestObjectV8Internal::namedPropertySetterCallback, TestO bjectV8Internal::namedPropertyQueryCallback, TestObjectV8Internal::namedProperty DeleterCallback, TestObjectV8Internal::namedPropertyEnumeratorCallback);
12611 config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(co nfig.flags) | static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStrings)) ;
12612 config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(co nfig.flags) | static_cast<int>(v8::PropertyHandlerFlags::kNonMasking));
12633 functionTemplate->InstanceTemplate()->SetHandler(config); 12613 functionTemplate->InstanceTemplate()->SetHandler(config);
12634 } 12614 }
12635 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI teratorConfiguration = { v8::Symbol::GetIterator, TestObjectV8Internal::iterator MethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts }; 12615 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI teratorConfiguration = { v8::Symbol::GetIterator, TestObjectV8Internal::iterator MethodCallback, 0, V8DOMConfiguration::ExposedToAllScripts };
12636 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu re, v8::DontDelete, symbolKeyedIteratorConfiguration); 12616 V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignatu re, v8::DontDelete, symbolKeyedIteratorConfiguration);
12637 const V8DOMConfiguration::MethodConfiguration staticVoidMethodMethodConfigur ation = { 12617 const V8DOMConfiguration::MethodConfiguration staticVoidMethodMethodConfigur ation = {
12638 "staticVoidMethod", TestObjectV8Internal::staticVoidMethodMethodCallback , 0, 0, V8DOMConfiguration::ExposedToAllScripts, 12618 "staticVoidMethod", TestObjectV8Internal::staticVoidMethodMethodCallback , 0, 0, V8DOMConfiguration::ExposedToAllScripts,
12639 }; 12619 };
12640 V8DOMConfiguration::installMethod(isolate, functionTemplate, v8::Local<v8::S ignature>(), v8::None, staticVoidMethodMethodConfiguration); 12620 V8DOMConfiguration::installMethod(isolate, functionTemplate, v8::Local<v8::S ignature>(), v8::None, staticVoidMethodMethodConfiguration);
12641 const V8DOMConfiguration::MethodConfiguration overloadedStaticMethodMethodCo nfiguration = { 12621 const V8DOMConfiguration::MethodConfiguration overloadedStaticMethodMethodCo nfiguration = {
12642 "overloadedStaticMethod", TestObjectV8Internal::overloadedStaticMethodMe thodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts, 12622 "overloadedStaticMethod", TestObjectV8Internal::overloadedStaticMethodMe thodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts,
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
13228 return false; 13208 return false;
13229 13209
13230 ScriptState::Scope scope(scriptState); 13210 ScriptState::Scope scope(scriptState);
13231 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13211 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13232 13212
13233 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ; 13213 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ;
13234 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue)); 13214 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue));
13235 } 13215 }
13236 13216
13237 } // namespace blink 13217 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698