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

Side by Side Diff: Source/bindings/tests/results/V8TestObjectPython.cpp

Issue 144033007: IDL compiler: ForMainWorld for method arguments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceNode.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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 6597 matching lines...) Expand 10 before | Expand all | Expand 10 after
6608 imp->perWorldBindingsVoidMethod(); 6608 imp->perWorldBindingsVoidMethod();
6609 } 6609 }
6610 6610
6611 static void perWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::Funct ionCallbackInfo<v8::Value>& info) 6611 static void perWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::Funct ionCallbackInfo<v8::Value>& info)
6612 { 6612 {
6613 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6613 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
6614 TestObjectPythonV8Internal::perWorldBindingsVoidMethodMethodForMainWorld(inf o); 6614 TestObjectPythonV8Internal::perWorldBindingsVoidMethodMethodForMainWorld(inf o);
6615 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6615 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
6616 } 6616 }
6617 6617
6618 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethod(const v8::Func tionCallbackInfo<v8::Value>& info)
6619 {
6620 if (UNLIKELY(info.Length() < 1)) {
6621 throwTypeError(ExceptionMessages::failedToExecute("perWorldBindingsVoidM ethodTestInterfaceEmptyArg", "TestObjectPython", ExceptionMessages::notEnoughArg uments(1, info.Length())), info.GetIsolate());
6622 return;
6623 }
6624 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
6625 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::hasInstance(info[0], info.GetIsolate()) ? V8TestInterfaceEmpty::toNative(v 8::Handle<v8::Object>::Cast(info[0])) : 0);
6626 imp->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
6627 }
6628
6629 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
6630 {
6631 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
6632 TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgM ethod(info);
6633 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
6634 }
6635
6636 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodForMainWorld(co nst v8::FunctionCallbackInfo<v8::Value>& info)
6637 {
6638 if (UNLIKELY(info.Length() < 1)) {
6639 throwTypeError(ExceptionMessages::failedToExecute("perWorldBindingsVoidM ethodTestInterfaceEmptyArg", "TestObjectPython", ExceptionMessages::notEnoughArg uments(1, info.Length())), info.GetIsolate());
6640 return;
6641 }
6642 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
6643 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::hasInstance(info[0], info.GetIsolate()) ? V8TestInterfaceEmpty::toNative(v 8::Handle<v8::Object>::Cast(info[0])) : 0);
6644 imp->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
6645 }
6646
6647 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMain World(const v8::FunctionCallbackInfo<v8::Value>& info)
6648 {
6649 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
6650 TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgM ethodForMainWorld(info);
6651 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
6652 }
6653
6618 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(const v8 ::FunctionCallbackInfo<v8::Value>& info) 6654 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(const v8 ::FunctionCallbackInfo<v8::Value>& info)
6619 { 6655 {
6620 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 6656 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
6621 imp->activityLoggingForAllWorldsPerWorldBindingsVoidMethod(); 6657 imp->activityLoggingForAllWorldsPerWorldBindingsVoidMethod();
6622 } 6658 }
6623 6659
6624 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback( const v8::FunctionCallbackInfo<v8::Value>& info) 6660 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback( const v8::FunctionCallbackInfo<v8::Value>& info)
6625 { 6661 {
6626 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
6627 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext()); 6663 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext());
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
6675 imp->activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod(); 6711 imp->activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod();
6676 } 6712 }
6677 6713
6678 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCall backForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 6714 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCall backForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
6679 { 6715 {
6680 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6716 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
6681 TestObjectPythonV8Internal::activityLoggingForIsolatedWorldsPerWorldBindings VoidMethodMethodForMainWorld(info); 6717 TestObjectPythonV8Internal::activityLoggingForIsolatedWorldsPerWorldBindings VoidMethodMethodForMainWorld(info);
6682 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6718 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
6683 } 6719 }
6684 6720
6685 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethod(const v8::Func tionCallbackInfo<v8::Value>& info)
6686 {
6687 if (UNLIKELY(info.Length() < 1)) {
6688 throwTypeError(ExceptionMessages::failedToExecute("perWorldBindingsVoidM ethodTestInterfaceEmptyArg", "TestObjectPython", ExceptionMessages::notEnoughArg uments(1, info.Length())), info.GetIsolate());
6689 return;
6690 }
6691 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
6692 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::hasInstance(info[0], info.GetIsolate()) ? V8TestInterfaceEmpty::toNative(v 8::Handle<v8::Object>::Cast(info[0])) : 0);
6693 imp->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
6694 }
6695
6696 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
6697 {
6698 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
6699 TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgM ethod(info);
6700 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
6701 }
6702
6703 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodForMainWorld(co nst v8::FunctionCallbackInfo<v8::Value>& info)
6704 {
6705 if (UNLIKELY(info.Length() < 1)) {
6706 throwTypeError(ExceptionMessages::failedToExecute("perWorldBindingsVoidM ethodTestInterfaceEmptyArg", "TestObjectPython", ExceptionMessages::notEnoughArg uments(1, info.Length())), info.GetIsolate());
6707 return;
6708 }
6709 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
6710 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::hasInstance(info[0], info.GetIsolate()) ? V8TestInterfaceEmpty::toNative(v 8::Handle<v8::Object>::Cast(info[0])) : 0);
6711 imp->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
6712 }
6713
6714 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMain World(const v8::FunctionCallbackInfo<v8::Value>& info)
6715 {
6716 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
6717 TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgM ethodForMainWorld(info);
6718 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
6719 }
6720
6721 static void raisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) 6721 static void raisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info)
6722 { 6722 {
6723 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExcep tionVoidMethod", "TestObjectPython", info.Holder(), info.GetIsolate()); 6723 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExcep tionVoidMethod", "TestObjectPython", info.Holder(), info.GetIsolate());
6724 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 6724 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
6725 imp->raisesExceptionVoidMethod(exceptionState); 6725 imp->raisesExceptionVoidMethod(exceptionState);
6726 if (exceptionState.throwIfNeeded()) 6726 if (exceptionState.throwIfNeeded())
6727 return; 6727 return;
6728 } 6728 }
6729 6729
6730 static void raisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info) 6730 static void raisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info)
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
7269 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 7269 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2)
7270 {"customVoidMethod", TestObjectPythonV8Internal::customVoidMethodMethodCallb ack, 0, 0}, 7270 {"customVoidMethod", TestObjectPythonV8Internal::customVoidMethodMethodCallb ack, 0, 0},
7271 #if ENABLE(CONDITION) 7271 #if ENABLE(CONDITION)
7272 {"conditionalConditionCustomVoidMethod", TestObjectPythonV8Internal::conditi onalConditionCustomVoidMethodMethodCallback, 0, 0}, 7272 {"conditionalConditionCustomVoidMethod", TestObjectPythonV8Internal::conditi onalConditionCustomVoidMethodMethodCallback, 0, 0},
7273 #endif // ENABLE(CONDITION) 7273 #endif // ENABLE(CONDITION)
7274 {"customElementCallbacksVoidMethod", TestObjectPythonV8Internal::customEleme ntCallbacksVoidMethodMethodCallback, 0, 0}, 7274 {"customElementCallbacksVoidMethod", TestObjectPythonV8Internal::customEleme ntCallbacksVoidMethodMethodCallback, 0, 0},
7275 {"deprecatedVoidMethod", TestObjectPythonV8Internal::deprecatedVoidMethodMet hodCallback, 0, 0}, 7275 {"deprecatedVoidMethod", TestObjectPythonV8Internal::deprecatedVoidMethodMet hodCallback, 0, 0},
7276 {"implementedAsVoidMethod", TestObjectPythonV8Internal::implementedAsVoidMet hodMethodCallback, 0, 0}, 7276 {"implementedAsVoidMethod", TestObjectPythonV8Internal::implementedAsVoidMet hodMethodCallback, 0, 0},
7277 {"measureAsVoidMethod", TestObjectPythonV8Internal::measureAsVoidMethodMetho dCallback, 0, 0}, 7277 {"measureAsVoidMethod", TestObjectPythonV8Internal::measureAsVoidMethodMetho dCallback, 0, 0},
7278 {"perWorldBindingsVoidMethod", TestObjectPythonV8Internal::perWorldBindingsV oidMethodMethodCallback, TestObjectPythonV8Internal::perWorldBindingsVoidMethodM ethodCallbackForMainWorld, 0}, 7278 {"perWorldBindingsVoidMethod", TestObjectPythonV8Internal::perWorldBindingsV oidMethodMethodCallback, TestObjectPythonV8Internal::perWorldBindingsVoidMethodM ethodCallbackForMainWorld, 0},
7279 {"perWorldBindingsVoidMethodTestInterfaceEmptyArg", TestObjectPythonV8Intern al::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback, TestObjectPyt honV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForM ainWorld, 1},
7279 {"activityLoggingForAllWorldsPerWorldBindingsVoidMethod", TestObjectPythonV8 Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback, T estObjectPythonV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethod MethodCallbackForMainWorld, 0}, 7280 {"activityLoggingForAllWorldsPerWorldBindingsVoidMethod", TestObjectPythonV8 Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback, T estObjectPythonV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethod MethodCallbackForMainWorld, 0},
7280 {"activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod", TestObjectPyt honV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodC allback, TestObjectPythonV8Internal::activityLoggingForIsolatedWorldsPerWorldBin dingsVoidMethodMethodCallbackForMainWorld, 0}, 7281 {"activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod", TestObjectPyt honV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodC allback, TestObjectPythonV8Internal::activityLoggingForIsolatedWorldsPerWorldBin dingsVoidMethodMethodCallbackForMainWorld, 0},
7281 {"perWorldBindingsVoidMethodTestInterfaceEmptyArg", TestObjectPythonV8Intern al::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback, TestObjectPyt honV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForM ainWorld, 1},
7282 {"raisesExceptionVoidMethod", TestObjectPythonV8Internal::raisesExceptionVoi dMethodMethodCallback, 0, 0}, 7282 {"raisesExceptionVoidMethod", TestObjectPythonV8Internal::raisesExceptionVoi dMethodMethodCallback, 0, 0},
7283 {"raisesExceptionStringMethod", TestObjectPythonV8Internal::raisesExceptionS tringMethodMethodCallback, 0, 0}, 7283 {"raisesExceptionStringMethod", TestObjectPythonV8Internal::raisesExceptionS tringMethodMethodCallback, 0, 0},
7284 {"raisesExceptionVoidMethodOptionalLongArg", TestObjectPythonV8Internal::rai sesExceptionVoidMethodOptionalLongArgMethodCallback, 0, 0}, 7284 {"raisesExceptionVoidMethodOptionalLongArg", TestObjectPythonV8Internal::rai sesExceptionVoidMethodOptionalLongArgMethodCallback, 0, 0},
7285 {"raisesExceptionVoidMethodTestCallbackInterfaceArg", TestObjectPythonV8Inte rnal::raisesExceptionVoidMethodTestCallbackInterfaceArgMethodCallback, 0, 1}, 7285 {"raisesExceptionVoidMethodTestCallbackInterfaceArg", TestObjectPythonV8Inte rnal::raisesExceptionVoidMethodTestCallbackInterfaceArgMethodCallback, 0, 1},
7286 {"raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg", TestObjectPyth onV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCal lback, 0, 0}, 7286 {"raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg", TestObjectPyth onV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCal lback, 0, 0},
7287 {"raisesExceptionTestInterfaceEmptyVoidMethod", TestObjectPythonV8Internal:: raisesExceptionTestInterfaceEmptyVoidMethodMethodCallback, 0, 0}, 7287 {"raisesExceptionTestInterfaceEmptyVoidMethod", TestObjectPythonV8Internal:: raisesExceptionTestInterfaceEmptyVoidMethodMethodCallback, 0, 0},
7288 {"strictTypeCheckingVoidMethodTestInterfaceEmptyArg", TestObjectPythonV8Inte rnal::strictTypeCheckingVoidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, 7288 {"strictTypeCheckingVoidMethodTestInterfaceEmptyArg", TestObjectPythonV8Inte rnal::strictTypeCheckingVoidMethodTestInterfaceEmptyArgMethodCallback, 0, 1},
7289 {"strictTypeCheckingVoidMethodNullableTestInterfaceEmptyArg", TestObjectPyth onV8Internal::strictTypeCheckingVoidMethodNullableTestInterfaceEmptyArgMethodCal lback, 0, 1}, 7289 {"strictTypeCheckingVoidMethodNullableTestInterfaceEmptyArg", TestObjectPyth onV8Internal::strictTypeCheckingVoidMethodNullableTestInterfaceEmptyArgMethodCal lback, 0, 1},
7290 {"treatReturnedNullStringAsNullStringMethod", TestObjectPythonV8Internal::tr eatReturnedNullStringAsNullStringMethodMethodCallback, 0, 0}, 7290 {"treatReturnedNullStringAsNullStringMethod", TestObjectPythonV8Internal::tr eatReturnedNullStringAsNullStringMethodMethodCallback, 0, 0},
7291 {"treatReturnedNullStringAsUndefinedStringMethod", TestObjectPythonV8Interna l::treatReturnedNullStringAsUndefinedStringMethodMethodCallback, 0, 0}, 7291 {"treatReturnedNullStringAsUndefinedStringMethod", TestObjectPythonV8Interna l::treatReturnedNullStringAsUndefinedStringMethodMethodCallback, 0, 0},
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
7448 fromInternalPointer(object)->deref(); 7448 fromInternalPointer(object)->deref();
7449 } 7449 }
7450 7450
7451 template<> 7451 template<>
7452 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate) 7452 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate)
7453 { 7453 {
7454 return toV8(impl, creationContext, isolate); 7454 return toV8(impl, creationContext, isolate);
7455 } 7455 }
7456 7456
7457 } // namespace WebCore 7457 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698