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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.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/V8TestInterfaceOriginTrialEnabled.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
index b1ba237d0cf6a95a4a50613f02234ca0eeec7dd1..8fa607ddcfd1e8811f6d50ab1070f776689f6e71 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp
@@ -51,7 +51,9 @@ namespace TestInterfaceOriginTrialEnabledV8Internal {
static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
+
TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder);
+
v8SetReturnValue(info, impl->doubleAttribute());
}
@@ -63,24 +65,31 @@ void doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::V
static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
- ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribute", "TestInterfaceOriginTrialEnabled", holder, info.GetIsolate());
TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder);
+
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterfaceOriginTrialEnabled", "doubleAttribute");
+
+ // Prepare the value to be set.
double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionState);
if (exceptionState.hadException())
return;
+
impl->setDoubleAttribute(cppValue);
}
void doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Value> v8Value = info[0];
+
TestInterfaceOriginTrialEnabledV8Internal::doubleAttributeAttributeSetter(v8Value, info);
}
static void conditionalLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
+
TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder);
+
v8SetReturnValueInt(info, impl->conditionalLongAttribute());
}
@@ -92,24 +101,31 @@ void conditionalLongAttributeAttributeGetterCallback(const v8::FunctionCallbackI
static void conditionalLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
- ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalLongAttribute", "TestInterfaceOriginTrialEnabled", holder, info.GetIsolate());
TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder);
+
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterfaceOriginTrialEnabled", "conditionalLongAttribute");
+
+ // Prepare the value to be set.
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
if (exceptionState.hadException())
return;
+
impl->setConditionalLongAttribute(cppValue);
}
void conditionalLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Value> v8Value = info[0];
+
TestInterfaceOriginTrialEnabledV8Internal::conditionalLongAttributeAttributeSetter(v8Value, info);
}
static void conditionalReadOnlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
+
TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder);
+
v8SetReturnValueInt(info, impl->conditionalReadOnlyLongAttribute());
}
@@ -130,15 +146,18 @@ void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo
static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ // Prepare the value to be set.
V8StringResource<> cppValue = v8Value;
if (!cppValue.prepare())
return;
+
TestInterfaceOriginTrialEnabled::setStaticStringAttribute(cppValue);
}
void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Value> v8Value = info[0];
+
TestInterfaceOriginTrialEnabledV8Internal::staticStringAttributeAttributeSetter(v8Value, info);
}

Powered by Google App Engine
This is Rietveld 408576698