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

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

Issue 1202683002: bindings: Supports per-member [Exposed] for attributes on prototype. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 5 years, 6 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 4351f7d09f44abe829d7dba731be962a8adb830f..17417c82887c239b1cee3a954906481916f98171 100644
--- a/Source/bindings/tests/results/core/V8TestInterface.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -2476,63 +2476,18 @@ TestInterfaceImplementation* V8TestInterface::toImplWithTypeCheck(v8::Isolate* i
return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0;
}
-void V8TestInterface::installConditionallyEnabledProperties(v8::Local<v8::Object> instanceObject, v8::Isolate* isolate)
+void V8TestInterface::preparePrototypeObject(v8::Isolate* isolate, v8::Local<v8::Object> prototypeObject, v8::Local<v8::FunctionTemplate> interfaceTemplate)
{
- v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instanceObject->GetPrototype());
ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext());
-
-if (context && (context->isWorkerGlobalScope())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isDocument())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isWorkerGlobalScope())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isDocument())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isWorkerGlobalScope())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isDocument())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isDocument())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isDocument())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isDocument())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isDocument())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && ((context->isDocument() && RuntimeEnabledFeatures::featureNameEnabled()) || (context->isWorkerGlobalScope() && RuntimeEnabledFeatures::featureName2Enabled()))) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-if (context && (context->isDocument() || context->isServiceWorkerGlobalScope())) {
- #error No one is actually using per-member [Exposed] extended attribute. Not supported. Contact to blink-reviews-bindings@ if you need.
- // TODO(yukishiino): Implement the feature again if there is a client.
-}
-}
-
-void V8TestInterface::preparePrototypeObject(v8::Isolate* isolate, v8::Local<v8::Object> prototypeObject)
-{
+ v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
+ if (context && (context->isWorkerGlobalScope())) {
+ static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {"workerExposedAttribute", TestInterfaceImplementationV8Internal::workerExposedAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::workerExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder};
+ V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), prototypeObject, v8::Local<v8::Function>(), signature, accessorConfiguration);
+ }
+ if (context && (context->isDocument())) {
+ static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {"windowExposedAttribute", TestInterfaceImplementationV8Internal::windowExposedAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::windowExposedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder};
+ V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), prototypeObject, v8::Local<v8::Function>(), signature, accessorConfiguration);
+ }
v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate));
ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext());
ASSERT(context);
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterface.h ('k') | Source/bindings/tests/results/core/V8TestInterface2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698