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

Unified Diff: Source/bindings/tests/results/V8TestObjectPython.cpp

Issue 53483004: IDL compiler: [Clamp] for arguments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/V8TestObjectPython.cpp
diff --git a/Source/bindings/tests/results/V8TestObjectPython.cpp b/Source/bindings/tests/results/V8TestObjectPython.cpp
index b0f883ebe84a515d3d0e6f5206fdaf22a426fd63..8fb5731baedbb53206bb14f704f7db76d97860c9 100644
--- a/Source/bindings/tests/results/V8TestObjectPython.cpp
+++ b/Source/bindings/tests/results/V8TestObjectPython.cpp
@@ -4765,6 +4765,31 @@ static void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethodCa
TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
}
+static void voidMethodClampUnsignedShortArgClampUnsignedLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
+{
+ if (UNLIKELY(args.Length() < 2)) {
+ throwTypeError(ExceptionMessages::failedToExecute("voidMethodClampUnsignedShortArgClampUnsignedLongArg", "TestObjectPython", ExceptionMessages::notEnoughArguments(2, args.Length())), args.GetIsolate());
+ return;
+ }
+ TestObjectPython* imp = V8TestObjectPython::toNative(args.Holder());
+ unsigned short clampUnsignedShortArg = 0;
+ V8TRYCATCH_VOID(double, clampUnsignedShortArgNativeValue, args[0]->NumberValue());
+ if (!std::isnan(clampUnsignedShortArgNativeValue))
+ clampUnsignedShortArg = clampTo<unsigned short>(clampUnsignedShortArgNativeValue);
+ unsigned long clampUnsignedLongArg = 0;
+ V8TRYCATCH_VOID(double, clampUnsignedLongArgNativeValue, args[1]->NumberValue());
+ if (!std::isnan(clampUnsignedLongArgNativeValue))
+ clampUnsignedLongArg = clampTo<unsigned long>(clampUnsignedLongArgNativeValue);
+ imp->voidMethodClampUnsignedShortArgClampUnsignedLongArg(clampUnsignedShortArg, clampUnsignedLongArg);
+}
+
+static void voidMethodClampUnsignedShortArgClampUnsignedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+ TestObjectPythonV8Internal::voidMethodClampUnsignedShortArgClampUnsignedLongArgMethod(args);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
} // namespace TestObjectPythonV8Internal
static const V8DOMConfiguration::AttributeConfiguration V8TestObjectPythonAttributes[] = {
@@ -4961,6 +4986,7 @@ static const V8DOMConfiguration::MethodConfiguration V8TestObjectPythonMethods[]
{"voidMethodTestInterfaceEmptyArgOptionalLongArg", TestObjectPythonV8Internal::voidMethodTestInterfaceEmptyArgOptionalLongArgMethodCallback, 0, 1},
{"voidMethodVariadicStringArg", TestObjectPythonV8Internal::voidMethodVariadicStringArgMethodCallback, 0, 1},
{"voidMethodStringArgVariadicStringArg", TestObjectPythonV8Internal::voidMethodStringArgVariadicStringArgMethodCallback, 0, 2},
+ {"voidMethodClampUnsignedShortArgClampUnsignedLongArg", TestObjectPythonV8Internal::voidMethodClampUnsignedShortArgClampUnsignedLongArgMethodCallback, 0, 2},
};
static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectPythonTemplate(v8::Handle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType)
« Source/bindings/templates/methods.cpp ('K') | « Source/bindings/tests/idls/TestObjectPython.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698