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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp

Issue 2342053002: binding: Refactors bindings/templates/attributes.cpp. (Closed)
Patch Set: Reverted the replacement from hidden values to private properties. Created 4 years, 3 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: third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
index ac2ebb4b3906a62b1edbd37c6a1fa525de54055e..6c792bad7b5a9f19a91b4564dfe1dde7ea4013b2 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
@@ -56,7 +56,9 @@ namespace TestTypedefsV8Internal {
static void uLongLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
+
TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
+
v8SetReturnValue(info, static_cast<double>(impl->uLongLongAttribute()));
}
@@ -68,26 +70,34 @@ void uLongLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8
static void uLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
- ExceptionState exceptionState(ExceptionState::SetterContext, "uLongLongAttribute", "TestTypedefs", holder, info.GetIsolate());
TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
+
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestTypedefs", "uLongLongAttribute");
+
+ // Prepare the value to be set.
unsigned long long cppValue = toUInt64(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
if (exceptionState.hadException())
return;
+
impl->setULongLongAttribute(cppValue);
}
void uLongLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Value> v8Value = info[0];
+
TestTypedefsV8Internal::uLongLongAttributeAttributeSetter(v8Value, info);
}
static void domStringOrDoubleOrNullAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
+
TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
+
StringOrDouble result;
impl->domStringOrDoubleOrNullAttribute(result);
+
v8SetReturnValue(info, result);
}
@@ -99,18 +109,23 @@ void domStringOrDoubleOrNullAttributeAttributeGetterCallback(const v8::FunctionC
static void domStringOrDoubleOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
- ExceptionState exceptionState(ExceptionState::SetterContext, "domStringOrDoubleOrNullAttribute", "TestTypedefs", holder, info.GetIsolate());
TestTypedefs* impl = V8TestTypedefs::toImpl(holder);
+
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestTypedefs", "domStringOrDoubleOrNullAttribute");
+
+ // Prepare the value to be set.
StringOrDouble cppValue;
V8StringOrDouble::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::Nullable, exceptionState);
if (exceptionState.hadException())
return;
+
impl->setDomStringOrDoubleOrNullAttribute(cppValue);
}
void domStringOrDoubleOrNullAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Value> v8Value = info[0];
+
TestTypedefsV8Internal::domStringOrDoubleOrNullAttributeAttributeSetter(v8Value, info);
}

Powered by Google App Engine
This is Rietveld 408576698