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

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

Issue 563793002: Use conversion helpers in V8Binding.cpp for [Clamp] method arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 8292 matching lines...) Expand 10 before | Expand all | Expand 10 after
8303 8303
8304 static void voidMethodClampUnsignedShortArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 8304 static void voidMethodClampUnsignedShortArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
8305 { 8305 {
8306 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodC lampUnsignedShortArg", "TestObject", info.Holder(), info.GetIsolate()); 8306 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodC lampUnsignedShortArg", "TestObject", info.Holder(), info.GetIsolate());
8307 if (UNLIKELY(info.Length() < 1)) { 8307 if (UNLIKELY(info.Length() < 1)) {
8308 setMinimumArityTypeError(exceptionState, 1, info.Length()); 8308 setMinimumArityTypeError(exceptionState, 1, info.Length());
8309 exceptionState.throwIfNeeded(); 8309 exceptionState.throwIfNeeded();
8310 return; 8310 return;
8311 } 8311 }
8312 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8312 TestObject* impl = V8TestObject::toImpl(info.Holder());
8313 unsigned clampUnsignedShortArg = 0; 8313 unsigned clampUnsignedShortArg;
8314 { 8314 {
8315 v8::TryCatch block; 8315 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(clampUnsignedShortArg, toUInt16(in fo[0], Clamp, exceptionState), exceptionState);
8316 V8RethrowTryCatchScope rethrow(block);
8317 double clampUnsignedShortArgNativeValue;
8318 TONATIVE_VOID_INTERNAL(clampUnsignedShortArgNativeValue, info[0]->Number Value());
8319 if (!std::isnan(clampUnsignedShortArgNativeValue))
8320 clampUnsignedShortArg = clampTo<unsigned short>(clampUnsignedShortAr gNativeValue);
8321 } 8316 }
8322 impl->voidMethodClampUnsignedShortArg(clampUnsignedShortArg); 8317 impl->voidMethodClampUnsignedShortArg(clampUnsignedShortArg);
8323 } 8318 }
8324 8319
8325 static void voidMethodClampUnsignedShortArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 8320 static void voidMethodClampUnsignedShortArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
8326 { 8321 {
8327 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8322 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
8328 TestObjectV8Internal::voidMethodClampUnsignedShortArgMethod(info); 8323 TestObjectV8Internal::voidMethodClampUnsignedShortArgMethod(info);
8329 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8324 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
8330 } 8325 }
8331 8326
8332 static void voidMethodClampUnsignedLongArgMethod(const v8::FunctionCallbackInfo< v8::Value>& info) 8327 static void voidMethodClampUnsignedLongArgMethod(const v8::FunctionCallbackInfo< v8::Value>& info)
8333 { 8328 {
8334 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodC lampUnsignedLongArg", "TestObject", info.Holder(), info.GetIsolate()); 8329 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodC lampUnsignedLongArg", "TestObject", info.Holder(), info.GetIsolate());
8335 if (UNLIKELY(info.Length() < 1)) { 8330 if (UNLIKELY(info.Length() < 1)) {
8336 setMinimumArityTypeError(exceptionState, 1, info.Length()); 8331 setMinimumArityTypeError(exceptionState, 1, info.Length());
8337 exceptionState.throwIfNeeded(); 8332 exceptionState.throwIfNeeded();
8338 return; 8333 return;
8339 } 8334 }
8340 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8335 TestObject* impl = V8TestObject::toImpl(info.Holder());
8341 unsigned clampUnsignedLongArg = 0; 8336 unsigned clampUnsignedLongArg;
8342 { 8337 {
8343 v8::TryCatch block; 8338 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(clampUnsignedLongArg, toUInt32(inf o[0], Clamp, exceptionState), exceptionState);
8344 V8RethrowTryCatchScope rethrow(block);
8345 double clampUnsignedLongArgNativeValue;
8346 TONATIVE_VOID_INTERNAL(clampUnsignedLongArgNativeValue, info[0]->NumberV alue());
8347 if (!std::isnan(clampUnsignedLongArgNativeValue))
8348 clampUnsignedLongArg = clampTo<unsigned long>(clampUnsignedLongArgNa tiveValue);
8349 } 8339 }
8350 impl->voidMethodClampUnsignedLongArg(clampUnsignedLongArg); 8340 impl->voidMethodClampUnsignedLongArg(clampUnsignedLongArg);
8351 } 8341 }
8352 8342
8353 static void voidMethodClampUnsignedLongArgMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info) 8343 static void voidMethodClampUnsignedLongArgMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info)
8354 { 8344 {
8355 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8345 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
8356 TestObjectV8Internal::voidMethodClampUnsignedLongArgMethod(info); 8346 TestObjectV8Internal::voidMethodClampUnsignedLongArgMethod(info);
8357 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8347 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
8358 } 8348 }
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after
11197 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "enumF orPrivateScript", holder, v8String(scriptState->isolate(), cppValue)); 11187 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "enumF orPrivateScript", holder, v8String(scriptState->isolate(), cppValue));
11198 if (block.HasCaught()) { 11188 if (block.HasCaught()) {
11199 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat e(), exceptionState, block); 11189 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat e(), exceptionState, block);
11200 block.ReThrow(); 11190 block.ReThrow();
11201 return false; 11191 return false;
11202 } 11192 }
11203 return true; 11193 return true;
11204 } 11194 }
11205 11195
11206 } // namespace blink 11196 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698