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

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

Issue 1193793003: bindings: Makes almost all attributes accessor-type properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. 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/V8TestInterfaceWillBeGarbageCollected.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp b/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp
index b3f0b383843890bcc42bb26e7b6f1439d4ba9878..9e0fbe02b703b2f47a407ab200e44ef9157865c9 100644
--- a/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp
@@ -39,21 +39,21 @@ const WrapperTypeInfo& TestInterfaceWillBeGarbageCollected::s_wrapperTypeInfo =
namespace TestInterfaceWillBeGarbageCollectedV8Internal {
-static void attr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+static void attr1AttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageCollected::toImpl(holder);
v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl);
}
-static void attr1AttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
+static void attr1AttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
-static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
+static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageCollected::toImpl(holder);
@@ -61,8 +61,9 @@ static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Propert
impl->setAttr1(WTF::getPtr(cppValue));
}
-static void attr1AttributeSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
+static void attr1AttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ v8::Local<v8::Value> v8Value = info[0];
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
@@ -109,18 +110,9 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
} // namespace TestInterfaceWillBeGarbageCollectedV8Internal
-// Suppress warning: global constructors, because AttributeConfiguration is trivial
-// and does not depend on another global objects.
-#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wglobal-constructors"
-#endif
-static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceWillBeGarbageCollectedAttributes[] = {
- {"attr1", TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGetterCallback, TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS_OVERWRITING), static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder},
+static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceWillBeGarbageCollectedAccessors[] = {
+ {"attr1", TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGetterCallback, TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder},
};
-#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
-#pragma clang diagnostic pop
-#endif
// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial
// and does not depend on another global objects.
@@ -200,8 +192,8 @@ static void installV8TestInterfaceWillBeGarbageCollectedTemplate(v8::Local<v8::F
v8::Local<v8::Signature> defaultSignature;
defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterfaceWillBeGarbageCollected", V8EventTarget::domTemplate(isolate), V8TestInterfaceWillBeGarbageCollected::internalFieldCount,
- V8TestInterfaceWillBeGarbageCollectedAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceWillBeGarbageCollectedAttributes),
0, 0,
+ V8TestInterfaceWillBeGarbageCollectedAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceWillBeGarbageCollectedAccessors),
0, 0);
functionTemplate->SetCallHandler(V8TestInterfaceWillBeGarbageCollected::constructorCallback);
functionTemplate->SetLength(1);

Powered by Google App Engine
This is Rietveld 408576698