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

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterface.cpp

Issue 860353002: IDL: Add toRestricted{Float,Double}() helpers to V8Binding.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add FIXME comment Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
102 TestInterfaceImplementationV8Internal::doubleAttributeAttributeGetter(info); 102 TestInterfaceImplementationV8Internal::doubleAttributeAttributeGetter(info);
103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
104 } 104 }
105 105
106 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::PropertyCallbackInfo<void>& info) 106 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::PropertyCallbackInfo<void>& info)
107 { 107 {
108 v8::Local<v8::Object> holder = info.Holder(); 108 v8::Local<v8::Object> holder = info.Holder();
109 ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribut e", "TestInterface", holder, info.GetIsolate()); 109 ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribut e", "TestInterface", holder, info.GetIsolate());
110 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 110 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
111 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toDouble(v8Value, exceptionSt ate), exceptionState); 111 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toRestrictedDouble(v8Value, e xceptionState), exceptionState);
112 if (!std::isfinite(cppValue)) {
113 exceptionState.throwTypeError("The provided double value is non-finite." );
114 exceptionState.throwIfNeeded();
115 return;
116 }
117 impl->setDoubleAttribute(cppValue); 112 impl->setDoubleAttribute(cppValue);
118 } 113 }
119 114
120 static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 115 static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
121 { 116 {
122 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 117 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
123 TestInterfaceImplementationV8Internal::doubleAttributeAttributeSetter(v8Valu e, info); 118 TestInterfaceImplementationV8Internal::doubleAttributeAttributeSetter(v8Valu e, info);
124 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 119 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
125 } 120 }
126 121
127 static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info) 122 static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info)
128 { 123 {
129 v8::Local<v8::Object> holder = info.Holder(); 124 v8::Local<v8::Object> holder = info.Holder();
130 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 125 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
131 v8SetReturnValue(info, impl->floatAttribute()); 126 v8SetReturnValue(info, impl->floatAttribute());
132 } 127 }
133 128
134 static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info) 129 static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info)
135 { 130 {
136 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 131 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
137 TestInterfaceImplementationV8Internal::floatAttributeAttributeGetter(info); 132 TestInterfaceImplementationV8Internal::floatAttributeAttributeGetter(info);
138 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 133 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
139 } 134 }
140 135
141 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::PropertyCallbackInfo<void>& info) 136 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::PropertyCallbackInfo<void>& info)
142 { 137 {
143 v8::Local<v8::Object> holder = info.Holder(); 138 v8::Local<v8::Object> holder = info.Holder();
144 ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute ", "TestInterface", holder, info.GetIsolate()); 139 ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute ", "TestInterface", holder, info.GetIsolate());
145 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 140 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
146 TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toFloat(v8Value, exceptionStat e), exceptionState); 141 TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toRestrictedFloat(v8Value, exc eptionState), exceptionState);
147 if (!std::isfinite(cppValue)) {
148 exceptionState.throwTypeError("The provided float value is non-finite.") ;
149 exceptionState.throwIfNeeded();
150 return;
151 }
152 impl->setFloatAttribute(cppValue); 142 impl->setFloatAttribute(cppValue);
153 } 143 }
154 144
155 static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 145 static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
156 { 146 {
157 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 147 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
158 TestInterfaceImplementationV8Internal::floatAttributeAttributeSetter(v8Value , info); 148 TestInterfaceImplementationV8Internal::floatAttributeAttributeSetter(v8Value , info);
159 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 149 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
160 } 150 }
161 151
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD oubleArgFloatArg", "TestInterface", info.Holder(), info.GetIsolate()); 978 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD oubleArgFloatArg", "TestInterface", info.Holder(), info.GetIsolate());
989 if (UNLIKELY(info.Length() < 2)) { 979 if (UNLIKELY(info.Length() < 2)) {
990 setMinimumArityTypeError(exceptionState, 2, info.Length()); 980 setMinimumArityTypeError(exceptionState, 2, info.Length());
991 exceptionState.throwIfNeeded(); 981 exceptionState.throwIfNeeded();
992 return; 982 return;
993 } 983 }
994 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 984 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
995 double doubleArg; 985 double doubleArg;
996 float floatArg; 986 float floatArg;
997 { 987 {
998 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], excep tionState), exceptionState); 988 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toRestrictedDouble(info [0], exceptionState), exceptionState);
999 if (!std::isfinite(doubleArg)) { 989 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(floatArg, toRestrictedFloat(info[1 ], exceptionState), exceptionState);
1000 exceptionState.throwTypeError("double parameter 1 is non-finite.");
1001 exceptionState.throwIfNeeded();
1002 return;
1003 }
1004 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(floatArg, toFloat(info[1], excepti onState), exceptionState);
1005 if (!std::isfinite(floatArg)) {
1006 exceptionState.throwTypeError("float parameter 2 is non-finite.");
1007 exceptionState.throwIfNeeded();
1008 return;
1009 }
1010 } 990 }
1011 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); 991 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg);
1012 } 992 }
1013 993
1014 static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info) 994 static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info)
1015 { 995 {
1016 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 996 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
1017 TestInterfaceImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(inf o); 997 TestInterfaceImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(inf o);
1018 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 998 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
1019 } 999 }
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 1274 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
1295 impl->voidMethodPartialOverload(); 1275 impl->voidMethodPartialOverload();
1296 } 1276 }
1297 1277
1298 static void voidMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v8:: Value>& info) 1278 static void voidMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v8:: Value>& info)
1299 { 1279 {
1300 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodP artialOverload", "TestInterface", info.Holder(), info.GetIsolate()); 1280 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodP artialOverload", "TestInterface", info.Holder(), info.GetIsolate());
1301 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 1281 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
1302 double doubleArg; 1282 double doubleArg;
1303 { 1283 {
1304 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], excep tionState), exceptionState); 1284 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toRestrictedDouble(info [0], exceptionState), exceptionState);
1305 if (!std::isfinite(doubleArg)) {
1306 exceptionState.throwTypeError("double parameter 1 is non-finite.");
1307 exceptionState.throwIfNeeded();
1308 return;
1309 }
1310 } 1285 }
1311 impl->voidMethodPartialOverload(doubleArg); 1286 impl->voidMethodPartialOverload(doubleArg);
1312 } 1287 }
1313 1288
1314 static void staticVoidMethodPartialOverload1Method(const v8::FunctionCallbackInf o<v8::Value>& info) 1289 static void staticVoidMethodPartialOverload1Method(const v8::FunctionCallbackInf o<v8::Value>& info)
1315 { 1290 {
1316 TestInterfaceImplementation::staticVoidMethodPartialOverload(); 1291 TestInterfaceImplementation::staticVoidMethodPartialOverload();
1317 } 1292 }
1318 1293
1319 static void promiseMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v 8::Value>& info) 1294 static void promiseMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v 8::Value>& info)
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
2378 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2353 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&))
2379 { 2354 {
2380 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method; 2355 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method;
2381 } 2356 }
2382 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2357 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
2383 { 2358 {
2384 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method; 2359 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method;
2385 } 2360 }
2386 } // namespace blink 2361 } // namespace blink
2387 #endif // ENABLE(CONDITION) 2362 #endif // ENABLE(CONDITION)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698