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

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

Issue 564063002: Generate simple code for "trivial" conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased 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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 65 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
66 { 66 {
67 v8::Handle<v8::Object> holder = info.Holder(); 67 v8::Handle<v8::Object> holder = info.Holder();
68 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA ttribute", "TestInterface", holder, info.GetIsolate()); 68 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA ttribute", "TestInterface", holder, info.GetIsolate());
69 if (!V8TestInterface::hasInstance(v8Value, info.GetIsolate())) { 69 if (!V8TestInterface::hasInstance(v8Value, info.GetIsolate())) {
70 exceptionState.throwTypeError("The provided value is not of type 'TestIn terface'."); 70 exceptionState.throwTypeError("The provided value is not of type 'TestIn terface'.");
71 exceptionState.throwIfNeeded(); 71 exceptionState.throwIfNeeded();
72 return; 72 return;
73 } 73 }
74 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 74 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
75 TONATIVE_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toImp lWithTypeCheck(info.GetIsolate(), v8Value)); 75 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck (info.GetIsolate(), v8Value);
76 impl->setTestInterfaceAttribute(WTF::getPtr(cppValue)); 76 impl->setTestInterfaceAttribute(WTF::getPtr(cppValue));
77 } 77 }
78 78
79 static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 79 static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
80 { 80 {
81 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 81 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
82 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter (v8Value, info); 82 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter (v8Value, info);
83 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 83 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
84 } 84 }
85 85
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 425 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
426 { 426 {
427 v8::Handle<v8::Object> holder = info.Holder(); 427 v8::Handle<v8::Object> holder = info.Holder();
428 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsNode Attribute", "TestInterface", holder, info.GetIsolate()); 428 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsNode Attribute", "TestInterface", holder, info.GetIsolate());
429 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) { 429 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) {
430 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); 430 exceptionState.throwTypeError("The provided value is not of type 'Node'. ");
431 exceptionState.throwIfNeeded(); 431 exceptionState.throwIfNeeded();
432 return; 432 return;
433 } 433 }
434 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 434 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
435 TONATIVE_VOID(Node*, cppValue, V8Node::toImplWithTypeCheck(info.GetIsolate() , v8Value)); 435 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value);
436 impl->setImplementsNodeAttribute(WTF::getPtr(cppValue)); 436 impl->setImplementsNodeAttribute(WTF::getPtr(cppValue));
437 } 437 }
438 438
439 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 439 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
440 { 440 {
441 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 441 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
442 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSette r(v8Value, info); 442 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSette r(v8Value, info);
443 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 443 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
444 } 444 }
445 445
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V alue> v8Value, const v8::PropertyCallbackInfo<void>& info) 490 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V alue> v8Value, const v8::PropertyCallbackInfo<void>& info)
491 { 491 {
492 v8::Handle<v8::Object> holder = info.Holder(); 492 v8::Handle<v8::Object> holder = info.Holder();
493 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsRunt imeEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); 493 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsRunt imeEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate());
494 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) { 494 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) {
495 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); 495 exceptionState.throwTypeError("The provided value is not of type 'Node'. ");
496 exceptionState.throwIfNeeded(); 496 exceptionState.throwIfNeeded();
497 return; 497 return;
498 } 498 }
499 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 499 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
500 TONATIVE_VOID(Node*, cppValue, V8Node::toImplWithTypeCheck(info.GetIsolate() , v8Value)); 500 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value);
501 impl->setImplementsRuntimeEnabledNodeAttribute(WTF::getPtr(cppValue)); 501 impl->setImplementsRuntimeEnabledNodeAttribute(WTF::getPtr(cppValue));
502 } 502 }
503 503
504 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc al<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi d>& info) 504 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc al<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi d>& info)
505 { 505 {
506 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 506 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
507 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute AttributeSetter(v8Value, info); 507 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute AttributeSetter(v8Value, info);
508 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 508 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
509 } 509 }
510 510
(...skipping 14 matching lines...) Expand all
525 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8 ::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 525 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8 ::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
526 { 526 {
527 v8::Handle<v8::Object> holder = info.Holder(); 527 v8::Handle<v8::Object> holder = info.Holder();
528 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsPerC ontextEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); 528 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsPerC ontextEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate());
529 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) { 529 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) {
530 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); 530 exceptionState.throwTypeError("The provided value is not of type 'Node'. ");
531 exceptionState.throwIfNeeded(); 531 exceptionState.throwIfNeeded();
532 return; 532 return;
533 } 533 }
534 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 534 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
535 TONATIVE_VOID(Node*, cppValue, V8Node::toImplWithTypeCheck(info.GetIsolate() , v8Value)); 535 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value);
536 impl->setImplementsPerContextEnabledNodeAttribute(WTF::getPtr(cppValue)); 536 impl->setImplementsPerContextEnabledNodeAttribute(WTF::getPtr(cppValue));
537 } 537 }
538 538
539 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8:: Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo< void>& info) 539 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8:: Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo< void>& info)
540 { 540 {
541 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 541 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
542 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttrib uteAttributeSetter(v8Value, info); 542 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttrib uteAttributeSetter(v8Value, info);
543 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 543 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
544 } 544 }
545 545
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 978
979 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 979 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
980 { 980 {
981 if (UNLIKELY(info.Length() < 1)) { 981 if (UNLIKELY(info.Length() < 1)) {
982 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("v oidMethodTestInterfaceEmptyArg", "TestInterface", 1, info.Length(), info.GetIsol ate()), info.GetIsolate()); 982 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("v oidMethodTestInterfaceEmptyArg", "TestInterface", 1, info.Length(), info.GetIsol ate()), info.GetIsolate());
983 return; 983 return;
984 } 984 }
985 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 985 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
986 TestInterfaceEmpty* testInterfaceEmptyArg; 986 TestInterfaceEmpty* testInterfaceEmptyArg;
987 { 987 {
988 v8::TryCatch block;
989 V8RethrowTryCatchScope rethrow(block);
990 if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], inf o.GetIsolate())) { 988 if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], inf o.GetIsolate())) {
991 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute( "voidMethodTestInterfaceEmptyArg", "TestInterface", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate()); 989 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute( "voidMethodTestInterfaceEmptyArg", "TestInterface", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate());
992 return; 990 return;
993 } 991 }
994 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toIm plWithTypeCheck(info.GetIsolate(), info[0])); 992 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[0]);
995 } 993 }
996 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 994 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
997 } 995 }
998 996
999 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 997 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
1000 { 998 {
1001 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 999 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
1002 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod (info); 1000 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod (info);
1003 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1001 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
1004 } 1002 }
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC omplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); 1218 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC omplexMethod", "TestInterface", info.Holder(), info.GetIsolate());
1221 if (UNLIKELY(info.Length() < 2)) { 1219 if (UNLIKELY(info.Length() < 2)) {
1222 setMinimumArityTypeError(exceptionState, 2, info.Length()); 1220 setMinimumArityTypeError(exceptionState, 2, info.Length());
1223 exceptionState.throwIfNeeded(); 1221 exceptionState.throwIfNeeded();
1224 return; 1222 return;
1225 } 1223 }
1226 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 1224 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
1227 V8StringResource<> strArg; 1225 V8StringResource<> strArg;
1228 TestInterfaceEmpty* testInterfaceEmptyArg; 1226 TestInterfaceEmpty* testInterfaceEmptyArg;
1229 { 1227 {
1230 v8::TryCatch block;
1231 V8RethrowTryCatchScope rethrow(block);
1232 TOSTRING_VOID_INTERNAL(strArg, info[0]); 1228 TOSTRING_VOID_INTERNAL(strArg, info[0]);
1233 if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], inf o.GetIsolate())) { 1229 if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], inf o.GetIsolate())) {
1234 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter faceEmpty'."); 1230 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter faceEmpty'.");
1235 exceptionState.throwIfNeeded(); 1231 exceptionState.throwIfNeeded();
1236 return; 1232 return;
1237 } 1233 }
1238 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toIm plWithTypeCheck(info.GetIsolate(), info[1])); 1234 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[1]);
1239 } 1235 }
1240 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 1236 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
1241 RefPtr<TestInterfaceEmpty> result = impl->implementsComplexMethod(executionC ontext, strArg, testInterfaceEmptyArg, exceptionState); 1237 RefPtr<TestInterfaceEmpty> result = impl->implementsComplexMethod(executionC ontext, strArg, testInterfaceEmptyArg, exceptionState);
1242 if (exceptionState.hadException()) { 1238 if (exceptionState.hadException()) {
1243 exceptionState.throwIfNeeded(); 1239 exceptionState.throwIfNeeded();
1244 return; 1240 return;
1245 } 1241 }
1246 v8SetReturnValue(info, result.release()); 1242 v8SetReturnValue(info, result.release());
1247 } 1243 }
1248 1244
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 { 1394 {
1399 if (UNLIKELY(info.Length() < 1)) { 1395 if (UNLIKELY(info.Length() < 1)) {
1400 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("p artialVoidMethodPartialCallbackTypeArg", "TestInterface", 1, info.Length(), info .GetIsolate()), info.GetIsolate()); 1396 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("p artialVoidMethodPartialCallbackTypeArg", "TestInterface", 1, info.Length(), info .GetIsolate()), info.GetIsolate());
1401 return; 1397 return;
1402 } 1398 }
1403 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 1399 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
1404 ScriptValue partialCallbackTypeArg; 1400 ScriptValue partialCallbackTypeArg;
1405 { 1401 {
1406 v8::TryCatch block; 1402 v8::TryCatch block;
1407 V8RethrowTryCatchScope rethrow(block); 1403 V8RethrowTryCatchScope rethrow(block);
1408 TONATIVE_VOID_INTERNAL(partialCallbackTypeArg, ScriptValue(ScriptState:: current(info.GetIsolate()), info[0])); 1404 partialCallbackTypeArg = ScriptValue(ScriptState::current(info.GetIsolat e()), info[0]);
1409 } 1405 }
1410 TestPartialInterface::partialVoidMethodPartialCallbackTypeArg(*impl, partial CallbackTypeArg); 1406 TestPartialInterface::partialVoidMethodPartialCallbackTypeArg(*impl, partial CallbackTypeArg);
1411 } 1407 }
1412 #endif // ENABLE(PARTIAL_CONDITION) 1408 #endif // ENABLE(PARTIAL_CONDITION)
1413 1409
1414 #if ENABLE(PARTIAL_CONDITION) 1410 #if ENABLE(PARTIAL_CONDITION)
1415 static void partialVoidMethodPartialCallbackTypeArgMethodCallback(const v8::Func tionCallbackInfo<v8::Value>& info) 1411 static void partialVoidMethodPartialCallbackTypeArgMethodCallback(const v8::Func tionCallbackInfo<v8::Value>& info)
1416 { 1412 {
1417 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 1413 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
1418 TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeA rgMethod(info); 1414 TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeA rgMethod(info);
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
2181 if (block.HasCaught()) { 2177 if (block.HasCaught()) {
2182 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat e(), exceptionState, block); 2178 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat e(), exceptionState, block);
2183 block.ReThrow(); 2179 block.ReThrow();
2184 return false; 2180 return false;
2185 } 2181 }
2186 return true; 2182 return true;
2187 } 2183 }
2188 2184
2189 } // namespace blink 2185 } // namespace blink
2190 #endif // ENABLE(CONDITION) 2186 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698