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

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

Issue 1051753003: bindings: Add toBoolean() to V8Binding.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 static void booleanAttributeAttributeGetterCallback(v8::Local<v8::Name>, const v 8::PropertyCallbackInfo<v8::Value>& info) 368 static void booleanAttributeAttributeGetterCallback(v8::Local<v8::Name>, const v 8::PropertyCallbackInfo<v8::Value>& info)
369 { 369 {
370 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 370 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
371 TestObjectV8Internal::booleanAttributeAttributeGetter(info); 371 TestObjectV8Internal::booleanAttributeAttributeGetter(info);
372 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 372 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
373 } 373 }
374 374
375 static void booleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 375 static void booleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
376 { 376 {
377 v8::Local<v8::Object> holder = info.Holder(); 377 v8::Local<v8::Object> holder = info.Holder();
378 ExceptionState exceptionState(ExceptionState::SetterContext, "booleanAttribu te", "TestObject", holder, info.GetIsolate());
378 TestObject* impl = V8TestObject::toImpl(holder); 379 TestObject* impl = V8TestObject::toImpl(holder);
379 bool cppValue = v8Value->BooleanValue(); 380 bool cppValue = toBoolean(info.GetIsolate(), v8Value, exceptionState);
381 if (exceptionState.throwIfNeeded())
382 return;
380 impl->setBooleanAttribute(cppValue); 383 impl->setBooleanAttribute(cppValue);
381 } 384 }
382 385
383 static void booleanAttributeAttributeSetterCallback(v8::Local<v8::Name>, v8::Loc al<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 386 static void booleanAttributeAttributeSetterCallback(v8::Local<v8::Name>, v8::Loc al<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
384 { 387 {
385 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 388 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
386 TestObjectV8Internal::booleanAttributeAttributeSetter(v8Value, info); 389 TestObjectV8Internal::booleanAttributeAttributeSetter(v8Value, info);
387 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 390 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
388 } 391 }
389 392
(...skipping 3432 matching lines...) Expand 10 before | Expand all | Expand 10 after
3822 static void reflectBooleanAttributeAttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) 3825 static void reflectBooleanAttributeAttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
3823 { 3826 {
3824 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3827 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
3825 TestObjectV8Internal::reflectBooleanAttributeAttributeGetter(info); 3828 TestObjectV8Internal::reflectBooleanAttributeAttributeGetter(info);
3826 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3829 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
3827 } 3830 }
3828 3831
3829 static void reflectBooleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3832 static void reflectBooleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3830 { 3833 {
3831 v8::Local<v8::Object> holder = info.Holder(); 3834 v8::Local<v8::Object> holder = info.Holder();
3835 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectBoolean Attribute", "TestObject", holder, info.GetIsolate());
3832 TestObject* impl = V8TestObject::toImpl(holder); 3836 TestObject* impl = V8TestObject::toImpl(holder);
3833 bool cppValue = v8Value->BooleanValue(); 3837 bool cppValue = toBoolean(info.GetIsolate(), v8Value, exceptionState);
3838 if (exceptionState.throwIfNeeded())
3839 return;
3834 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3840 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
3835 impl->setBooleanAttribute(HTMLNames::reflectbooleanattributeAttr, cppValue); 3841 impl->setBooleanAttribute(HTMLNames::reflectbooleanattributeAttr, cppValue);
3836 } 3842 }
3837 3843
3838 static void reflectBooleanAttributeAttributeSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3844 static void reflectBooleanAttributeAttributeSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3839 { 3845 {
3840 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3846 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
3841 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3847 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
3842 TestObjectV8Internal::reflectBooleanAttributeAttributeSetter(v8Value, info); 3848 TestObjectV8Internal::reflectBooleanAttributeAttributeSetter(v8Value, info);
3843 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3849 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
(...skipping 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after
5932 5938
5933 static void voidMethodDOMTimeStampArgMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info) 5939 static void voidMethodDOMTimeStampArgMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info)
5934 { 5940 {
5935 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5941 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
5936 TestObjectV8Internal::voidMethodDOMTimeStampArgMethod(info); 5942 TestObjectV8Internal::voidMethodDOMTimeStampArgMethod(info);
5937 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5943 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
5938 } 5944 }
5939 5945
5940 static void voidMethodBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value> & info) 5946 static void voidMethodBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value> & info)
5941 { 5947 {
5948 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodB ooleanArg", "TestObject", info.Holder(), info.GetIsolate());
5942 if (UNLIKELY(info.Length() < 1)) { 5949 if (UNLIKELY(info.Length() < 1)) {
5943 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "voidMethodBooleanArg", "TestObject", 1, info.Length()), info.G etIsolate()); 5950 setMinimumArityTypeError(exceptionState, 1, info.Length());
5951 exceptionState.throwIfNeeded();
5944 return; 5952 return;
5945 } 5953 }
5946 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5954 TestObject* impl = V8TestObject::toImpl(info.Holder());
5947 bool booleanArg; 5955 bool booleanArg;
5948 { 5956 {
5949 booleanArg = info[0]->BooleanValue(); 5957 booleanArg = toBoolean(info.GetIsolate(), info[0], exceptionState);
5958 if (exceptionState.throwIfNeeded())
5959 return;
5950 } 5960 }
5951 impl->voidMethodBooleanArg(booleanArg); 5961 impl->voidMethodBooleanArg(booleanArg);
5952 } 5962 }
5953 5963
5954 static void voidMethodBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& info) 5964 static void voidMethodBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& info)
5955 { 5965 {
5956 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5966 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
5957 TestObjectV8Internal::voidMethodBooleanArgMethod(info); 5967 TestObjectV8Internal::voidMethodBooleanArgMethod(info);
5958 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5968 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
5959 } 5969 }
(...skipping 2252 matching lines...) Expand 10 before | Expand all | Expand 10 after
8212 8222
8213 static void voidMethodDefaultDoubleArgMethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& info) 8223 static void voidMethodDefaultDoubleArgMethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& info)
8214 { 8224 {
8215 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8225 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
8216 TestObjectV8Internal::voidMethodDefaultDoubleArgMethod(info); 8226 TestObjectV8Internal::voidMethodDefaultDoubleArgMethod(info);
8217 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8227 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
8218 } 8228 }
8219 8229
8220 static void voidMethodDefaultTrueBooleanArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 8230 static void voidMethodDefaultTrueBooleanArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
8221 { 8231 {
8232 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD efaultTrueBooleanArg", "TestObject", info.Holder(), info.GetIsolate());
8222 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8233 TestObject* impl = V8TestObject::toImpl(info.Holder());
8223 bool defaultBooleanArg; 8234 bool defaultBooleanArg;
8224 { 8235 {
8225 if (!info[0]->IsUndefined()) { 8236 if (!info[0]->IsUndefined()) {
8226 defaultBooleanArg = info[0]->BooleanValue(); 8237 defaultBooleanArg = toBoolean(info.GetIsolate(), info[0], exceptionS tate);
8238 if (exceptionState.throwIfNeeded())
8239 return;
8227 } else { 8240 } else {
8228 defaultBooleanArg = true; 8241 defaultBooleanArg = true;
8229 } 8242 }
8230 } 8243 }
8231 impl->voidMethodDefaultTrueBooleanArg(defaultBooleanArg); 8244 impl->voidMethodDefaultTrueBooleanArg(defaultBooleanArg);
8232 } 8245 }
8233 8246
8234 static void voidMethodDefaultTrueBooleanArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 8247 static void voidMethodDefaultTrueBooleanArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
8235 { 8248 {
8236 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8249 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
8237 TestObjectV8Internal::voidMethodDefaultTrueBooleanArgMethod(info); 8250 TestObjectV8Internal::voidMethodDefaultTrueBooleanArgMethod(info);
8238 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8251 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
8239 } 8252 }
8240 8253
8241 static void voidMethodDefaultFalseBooleanArgMethod(const v8::FunctionCallbackInf o<v8::Value>& info) 8254 static void voidMethodDefaultFalseBooleanArgMethod(const v8::FunctionCallbackInf o<v8::Value>& info)
8242 { 8255 {
8256 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodD efaultFalseBooleanArg", "TestObject", info.Holder(), info.GetIsolate());
8243 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8257 TestObject* impl = V8TestObject::toImpl(info.Holder());
8244 bool defaultBooleanArg; 8258 bool defaultBooleanArg;
8245 { 8259 {
8246 if (!info[0]->IsUndefined()) { 8260 if (!info[0]->IsUndefined()) {
8247 defaultBooleanArg = info[0]->BooleanValue(); 8261 defaultBooleanArg = toBoolean(info.GetIsolate(), info[0], exceptionS tate);
8262 if (exceptionState.throwIfNeeded())
8263 return;
8248 } else { 8264 } else {
8249 defaultBooleanArg = false; 8265 defaultBooleanArg = false;
8250 } 8266 }
8251 } 8267 }
8252 impl->voidMethodDefaultFalseBooleanArg(defaultBooleanArg); 8268 impl->voidMethodDefaultFalseBooleanArg(defaultBooleanArg);
8253 } 8269 }
8254 8270
8255 static void voidMethodDefaultFalseBooleanArgMethodCallback(const v8::FunctionCal lbackInfo<v8::Value>& info) 8271 static void voidMethodDefaultFalseBooleanArgMethodCallback(const v8::FunctionCal lbackInfo<v8::Value>& info)
8256 { 8272 {
8257 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8273 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
9938 9954
9939 static void callWithScriptStateScriptArgumentsVoidMethodMethodCallback(const v8: :FunctionCallbackInfo<v8::Value>& info) 9955 static void callWithScriptStateScriptArgumentsVoidMethodMethodCallback(const v8: :FunctionCallbackInfo<v8::Value>& info)
9940 { 9956 {
9941 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9957 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
9942 TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodMethod(inf o); 9958 TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodMethod(inf o);
9943 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9959 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
9944 } 9960 }
9945 9961
9946 static void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod (const v8::FunctionCallbackInfo<v8::Value>& info) 9962 static void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod (const v8::FunctionCallbackInfo<v8::Value>& info)
9947 { 9963 {
9964 ExceptionState exceptionState(ExceptionState::ExecutionContext, "callWithScr iptStateScriptArgumentsVoidMethodOptionalBooleanArg", "TestObject", info.Holder( ), info.GetIsolate());
9948 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9965 TestObject* impl = V8TestObject::toImpl(info.Holder());
9949 bool optionalBooleanArg; 9966 bool optionalBooleanArg;
9950 { 9967 {
9951 if (UNLIKELY(info.Length() <= 0)) { 9968 if (UNLIKELY(info.Length() <= 0)) {
9952 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 9969 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
9953 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArgu ments(scriptState, info, 1)); 9970 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArgu ments(scriptState, info, 1));
9954 impl->callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg (scriptState, scriptArguments.release()); 9971 impl->callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg (scriptState, scriptArguments.release());
9955 return; 9972 return;
9956 } 9973 }
9957 optionalBooleanArg = info[0]->BooleanValue(); 9974 optionalBooleanArg = toBoolean(info.GetIsolate(), info[0], exceptionStat e);
9975 if (exceptionState.throwIfNeeded())
9976 return;
9958 } 9977 }
9959 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 9978 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
9960 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArguments(sc riptState, info, 1)); 9979 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArguments(sc riptState, info, 1));
9961 impl->callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(scriptS tate, scriptArguments.release(), optionalBooleanArg); 9980 impl->callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(scriptS tate, scriptArguments.release(), optionalBooleanArg);
9962 } 9981 }
9963 9982
9964 static void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod Callback(const v8::FunctionCallbackInfo<v8::Value>& info) 9983 static void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod Callback(const v8::FunctionCallbackInfo<v8::Value>& info)
9965 { 9984 {
9966 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9985 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
9967 TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodOptionalBo oleanArgMethod(info); 9986 TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodOptionalBo oleanArgMethod(info);
(...skipping 3285 matching lines...) Expand 10 before | Expand all | Expand 10 after
13253 return false; 13272 return false;
13254 13273
13255 ScriptState::Scope scope(scriptState); 13274 ScriptState::Scope scope(scriptState);
13256 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate()); 13275 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa l(), scriptState->isolate());
13257 13276
13258 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ; 13277 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ;
13259 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue)); 13278 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue));
13260 } 13279 }
13261 13280
13262 } // namespace blink 13281 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698