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

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

Issue 1257613003: bindings: Supports inheritance of [Unforgeable] attributes as accessor-type properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made inherit_unforgeable_attributes more robust. Created 5 years, 5 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/V8TestInterfaceEventInitConstructor.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp b/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp
index e748f70dad3c8346713c1863dd100ee597d3e6de..5a79dc5bd90e720585d5c56e6496bc548f55b792 100644
--- a/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp
@@ -53,6 +53,20 @@ static void readonlyStringAttributeAttributeGetterCallback(const v8::FunctionCal
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
+static void isTrustedAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ v8::Local<v8::Object> holder = info.Holder();
+ TestInterfaceEventInitConstructor* impl = V8TestInterfaceEventInitConstructor::toImpl(holder);
+ v8SetReturnValueBool(info, impl->isTrusted());
+}
+
+static void isTrustedAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
+ TestInterfaceEventInitConstructorV8Internal::isTrustedAttributeGetter(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
+}
+
static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInterfaceEventInitConstructor", info.Holder(), info.GetIsolate());
@@ -119,6 +133,11 @@ static void installV8TestInterfaceEventInitConstructorTemplate(v8::Local<v8::Fun
ALLOW_UNUSED_LOCAL(instanceTemplate);
v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
ALLOW_UNUSED_LOCAL(prototypeTemplate);
+ if (RuntimeEnabledFeatures::trustedEventsEnabled()) {
+ static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = \
+ {"isTrusted", TestInterfaceEventInitConstructorV8Internal::isTrustedAttributeGetterCallback, 0, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder};
+ V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorConfiguration);
+ }
// Custom toString template
functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());

Powered by Google App Engine
This is Rietveld 408576698