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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 2730183003: bindings: Add C++ versions of WebIDL types and generalize NativeValueTraits. (Closed)
Patch Set: Created 3 years, 10 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/modules/V8TestInterface5.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
index 9c6ea666f5bb50de9c900dd5d5421ae0fa16fbd9..af2beea97c3b9bee6e61895656026efd307ed1be 100644
--- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
@@ -12,6 +12,8 @@
#include "V8TestInterface5.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/IDLTypes.h"
+#include "bindings/core/v8/V8BindingForIDLTypes.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
#include "bindings/core/v8/V8TestInterfaceEmpty.h"
@@ -98,7 +100,7 @@ static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterface5", "doubleAttribute");
// Prepare the value to be set.
- double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionState);
+ double cppValue = NativeValueTraits<IDLDouble>::nativeValue(info.GetIsolate(), v8Value, exceptionState);
if (exceptionState.hadException())
return;
@@ -120,7 +122,7 @@ static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterface5", "floatAttribute");
// Prepare the value to be set.
- float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionState);
+ float cppValue = NativeValueTraits<IDLFloat>::nativeValue(info.GetIsolate(), v8Value, exceptionState);
if (exceptionState.hadException())
return;
@@ -142,7 +144,7 @@ static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterface5", "unrestrictedDoubleAttribute");
// Prepare the value to be set.
- double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState);
+ double cppValue = NativeValueTraits<IDLUnrestrictedDouble>::nativeValue(info.GetIsolate(), v8Value, exceptionState);
if (exceptionState.hadException())
return;
@@ -164,7 +166,7 @@ static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterface5", "unrestrictedFloatAttribute");
// Prepare the value to be set.
- float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState);
+ float cppValue = NativeValueTraits<IDLUnrestrictedFloat>::nativeValue(info.GetIsolate(), v8Value, exceptionState);
if (exceptionState.hadException())
return;
@@ -207,7 +209,7 @@ static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterface5", "alwaysExposedAttribute");
// Prepare the value to be set.
- int32_t cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
+ int32_t cppValue = NativeValueTraits<IDLLong>::nativeValue(info.GetIsolate(), v8Value, exceptionState, NormalConversion);
if (exceptionState.hadException())
return;
@@ -229,7 +231,7 @@ static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterface5", "workerExposedAttribute");
// Prepare the value to be set.
- int32_t cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
+ int32_t cppValue = NativeValueTraits<IDLLong>::nativeValue(info.GetIsolate(), v8Value, exceptionState, NormalConversion);
if (exceptionState.hadException())
return;
@@ -251,7 +253,7 @@ static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterface5", "windowExposedAttribute");
// Prepare the value to be set.
- int32_t cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
+ int32_t cppValue = NativeValueTraits<IDLLong>::nativeValue(info.GetIsolate(), v8Value, exceptionState, NormalConversion);
if (exceptionState.hadException())
return;
@@ -289,11 +291,11 @@ static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8:
double doubleArg;
float floatArg;
- doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState);
+ doubleArg = NativeValueTraits<IDLDouble>::nativeValue(info.GetIsolate(), info[0], exceptionState);
if (exceptionState.hadException())
return;
- floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState);
+ floatArg = NativeValueTraits<IDLFloat>::nativeValue(info.GetIsolate(), info[1], exceptionState);
if (exceptionState.hadException())
return;
@@ -312,11 +314,11 @@ static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::
double unrestrictedDoubleArg;
float unrestrictedFloatArg;
- unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState);
+ unrestrictedDoubleArg = NativeValueTraits<IDLUnrestrictedDouble>::nativeValue(info.GetIsolate(), info[0], exceptionState);
if (exceptionState.hadException())
return;
- unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState);
+ unrestrictedFloatArg = NativeValueTraits<IDLUnrestrictedFloat>::nativeValue(info.GetIsolate(), info[1], exceptionState);
if (exceptionState.hadException())
return;

Powered by Google App Engine
This is Rietveld 408576698