OLD | NEW |
---|---|
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 #include "bindings/v8/V8ObjectConstructor.h" | 71 #include "bindings/v8/V8ObjectConstructor.h" |
72 #include "bindings/v8/custom/V8ArrayBufferCustom.h" | 72 #include "bindings/v8/custom/V8ArrayBufferCustom.h" |
73 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h" | 73 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h" |
74 #include "bindings/v8/custom/V8Float32ArrayCustom.h" | 74 #include "bindings/v8/custom/V8Float32ArrayCustom.h" |
75 #include "bindings/v8/custom/V8Int32ArrayCustom.h" | 75 #include "bindings/v8/custom/V8Int32ArrayCustom.h" |
76 #include "bindings/v8/custom/V8Uint8ArrayCustom.h" | 76 #include "bindings/v8/custom/V8Uint8ArrayCustom.h" |
77 #include "core/css/MediaQueryListListener.h" | 77 #include "core/css/MediaQueryListListener.h" |
78 #include "core/dom/ContextFeatures.h" | 78 #include "core/dom/ContextFeatures.h" |
79 #include "core/dom/Document.h" | 79 #include "core/dom/Document.h" |
80 #include "core/dom/custom/CustomElementCallbackDispatcher.h" | 80 #include "core/dom/custom/CustomElementCallbackDispatcher.h" |
81 #include "core/frame/DOMWindow.h" | |
81 #include "core/frame/UseCounter.h" | 82 #include "core/frame/UseCounter.h" |
82 #include "core/inspector/ScriptArguments.h" | 83 #include "core/inspector/ScriptArguments.h" |
83 #include "platform/TraceEvent.h" | 84 #include "platform/TraceEvent.h" |
84 #include "wtf/GetPtr.h" | 85 #include "wtf/GetPtr.h" |
85 #include "wtf/RefPtr.h" | 86 #include "wtf/RefPtr.h" |
86 | 87 |
87 namespace WebCore { | 88 namespace WebCore { |
88 | 89 |
89 static void initializeScriptWrappableForInterface(TestObjectPython* object) | 90 static void initializeScriptWrappableForInterface(TestObjectPython* object) |
90 { | 91 { |
(...skipping 6335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6426 impl->voidMethodEnforceRangeLongArg(enforceRangeLongArg); | 6427 impl->voidMethodEnforceRangeLongArg(enforceRangeLongArg); |
6427 } | 6428 } |
6428 | 6429 |
6429 static void voidMethodEnforceRangeLongArgMethodCallback(const v8::FunctionCallba ckInfo<v8::Value>& info) | 6430 static void voidMethodEnforceRangeLongArgMethodCallback(const v8::FunctionCallba ckInfo<v8::Value>& info) |
6430 { | 6431 { |
6431 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 6432 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
6432 TestObjectPythonV8Internal::voidMethodEnforceRangeLongArgMethod(info); | 6433 TestObjectPythonV8Internal::voidMethodEnforceRangeLongArgMethod(info); |
6433 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 6434 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
6434 } | 6435 } |
6435 | 6436 |
6437 static void voidMethodToNativeArgEventListenerArgMethod(const v8::FunctionCallba ckInfo<v8::Value>& info) | |
haraken
2014/03/19 04:44:17
I cannot find any ListenerFindOrCreate/ListenerFin
Nils Barth (inactive)
2014/03/19 06:12:48
Ah, good catch!
I looked into this, and it's a su
| |
6438 { | |
6439 if (UNLIKELY(info.Length() < 1)) { | |
6440 throwTypeError(ExceptionMessages::failedToExecute("voidMethodToNativeArg EventListenerArg", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); | |
6441 return; | |
6442 } | |
6443 TestObjectPython* impl = V8TestObjectPython::toNative(info.Holder()); | |
6444 if (info.Length() <= 0 || !info[0]->IsFunction()) { | |
6445 throwTypeError(ExceptionMessages::failedToExecute("voidMethodToNativeArg EventListenerArg", "TestObjectPython", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); | |
6446 return; | |
6447 } | |
6448 OwnPtr<EventListener> listener = V8EventListener::create(v8::Handle<v8::Func tion>::Cast(info[0]), currentExecutionContext(info.GetIsolate())); | |
6449 impl->voidMethodToNativeArgEventListenerArg(listener.release()); | |
6450 } | |
6451 | |
6452 static void voidMethodToNativeArgEventListenerArgMethodCallback(const v8::Functi onCallbackInfo<v8::Value>& info) | |
6453 { | |
6454 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | |
6455 TestObjectPythonV8Internal::voidMethodToNativeArgEventListenerArgMethod(info ); | |
6456 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
6457 } | |
6458 | |
6436 static void voidMethodTreatNullAsNullStringStringArgMethod(const v8::FunctionCal lbackInfo<v8::Value>& info) | 6459 static void voidMethodTreatNullAsNullStringStringArgMethod(const v8::FunctionCal lbackInfo<v8::Value>& info) |
6437 { | 6460 { |
6438 if (UNLIKELY(info.Length() < 1)) { | 6461 if (UNLIKELY(info.Length() < 1)) { |
6439 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTreatNullAs NullStringStringArg", "TestObjectPython", ExceptionMessages::notEnoughArguments( 1, info.Length())), info.GetIsolate()); | 6462 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTreatNullAs NullStringStringArg", "TestObjectPython", ExceptionMessages::notEnoughArguments( 1, info.Length())), info.GetIsolate()); |
6440 return; | 6463 return; |
6441 } | 6464 } |
6442 TestObjectPython* impl = V8TestObjectPython::toNative(info.Holder()); | 6465 TestObjectPython* impl = V8TestObjectPython::toNative(info.Holder()); |
6443 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, treatN ullAsNullStringStringArg, info[0]); | 6466 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, treatN ullAsNullStringStringArg, info[0]); |
6444 impl->voidMethodTreatNullAsNullStringStringArg(treatNullAsNullStringStringAr g); | 6467 impl->voidMethodTreatNullAsNullStringStringArg(treatNullAsNullStringStringAr g); |
6445 } | 6468 } |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7536 {"overloadedMethodG", TestObjectPythonV8Internal::overloadedMethodGMethodCal lback, 0, 0}, | 7559 {"overloadedMethodG", TestObjectPythonV8Internal::overloadedMethodGMethodCal lback, 0, 0}, |
7537 {"overloadedMethodH", TestObjectPythonV8Internal::overloadedMethodHMethodCal lback, 0, 0}, | 7560 {"overloadedMethodH", TestObjectPythonV8Internal::overloadedMethodHMethodCal lback, 0, 0}, |
7538 {"overloadedPerWorldBindingsMethod", TestObjectPythonV8Internal::overloadedP erWorldBindingsMethodMethodCallback, TestObjectPythonV8Internal::overloadedPerWo rldBindingsMethodMethodCallbackForMainWorld, 0}, | 7561 {"overloadedPerWorldBindingsMethod", TestObjectPythonV8Internal::overloadedP erWorldBindingsMethodMethodCallback, TestObjectPythonV8Internal::overloadedPerWo rldBindingsMethodMethodCallbackForMainWorld, 0}, |
7539 {"voidMethodClampUnsignedShortArg", TestObjectPythonV8Internal::voidMethodCl ampUnsignedShortArgMethodCallback, 0, 1}, | 7562 {"voidMethodClampUnsignedShortArg", TestObjectPythonV8Internal::voidMethodCl ampUnsignedShortArgMethodCallback, 0, 1}, |
7540 {"voidMethodClampUnsignedLongArg", TestObjectPythonV8Internal::voidMethodCla mpUnsignedLongArgMethodCallback, 0, 1}, | 7563 {"voidMethodClampUnsignedLongArg", TestObjectPythonV8Internal::voidMethodCla mpUnsignedLongArgMethodCallback, 0, 1}, |
7541 {"voidMethodDefaultUndefinedTestInterfaceEmptyArg", TestObjectPythonV8Intern al::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback, 0, 0}, | 7564 {"voidMethodDefaultUndefinedTestInterfaceEmptyArg", TestObjectPythonV8Intern al::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback, 0, 0}, |
7542 {"voidMethodDefaultUndefinedLongArg", TestObjectPythonV8Internal::voidMethod DefaultUndefinedLongArgMethodCallback, 0, 0}, | 7565 {"voidMethodDefaultUndefinedLongArg", TestObjectPythonV8Internal::voidMethod DefaultUndefinedLongArgMethodCallback, 0, 0}, |
7543 {"voidMethodDefaultUndefinedStringArg", TestObjectPythonV8Internal::voidMeth odDefaultUndefinedStringArgMethodCallback, 0, 0}, | 7566 {"voidMethodDefaultUndefinedStringArg", TestObjectPythonV8Internal::voidMeth odDefaultUndefinedStringArgMethodCallback, 0, 0}, |
7544 {"voidMethodDefaultNullStringStringArg", TestObjectPythonV8Internal::voidMet hodDefaultNullStringStringArgMethodCallback, 0, 0}, | 7567 {"voidMethodDefaultNullStringStringArg", TestObjectPythonV8Internal::voidMet hodDefaultNullStringStringArgMethodCallback, 0, 0}, |
7545 {"voidMethodEnforceRangeLongArg", TestObjectPythonV8Internal::voidMethodEnfo rceRangeLongArgMethodCallback, 0, 1}, | 7568 {"voidMethodEnforceRangeLongArg", TestObjectPythonV8Internal::voidMethodEnfo rceRangeLongArgMethodCallback, 0, 1}, |
7569 {"voidMethodToNativeArgEventListenerArg", TestObjectPythonV8Internal::voidMe thodToNativeArgEventListenerArgMethodCallback, 0, 1}, | |
7546 {"voidMethodTreatNullAsNullStringStringArg", TestObjectPythonV8Internal::voi dMethodTreatNullAsNullStringStringArgMethodCallback, 0, 1}, | 7570 {"voidMethodTreatNullAsNullStringStringArg", TestObjectPythonV8Internal::voi dMethodTreatNullAsNullStringStringArgMethodCallback, 0, 1}, |
7547 {"voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg", TestO bjectPythonV8Internal::voidMethodTreatNullAsNullStringTreatUndefinedAsNullString StringArgMethodCallback, 0, 1}, | 7571 {"voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg", TestO bjectPythonV8Internal::voidMethodTreatNullAsNullStringTreatUndefinedAsNullString StringArgMethodCallback, 0, 1}, |
7548 {"activityLoggingAccessForAllWorldsMethod", TestObjectPythonV8Internal::acti vityLoggingAccessForAllWorldsMethodMethodCallback, 0, 0}, | 7572 {"activityLoggingAccessForAllWorldsMethod", TestObjectPythonV8Internal::acti vityLoggingAccessForAllWorldsMethodMethodCallback, 0, 0}, |
7549 {"callWithScriptStateVoidMethod", TestObjectPythonV8Internal::callWithScript StateVoidMethodMethodCallback, 0, 0}, | 7573 {"callWithScriptStateVoidMethod", TestObjectPythonV8Internal::callWithScript StateVoidMethodMethodCallback, 0, 0}, |
7550 {"callWithScriptStateLongMethod", TestObjectPythonV8Internal::callWithScript StateLongMethodMethodCallback, 0, 0}, | 7574 {"callWithScriptStateLongMethod", TestObjectPythonV8Internal::callWithScript StateLongMethodMethodCallback, 0, 0}, |
7551 {"callWithExecutionContextVoidMethod", TestObjectPythonV8Internal::callWithE xecutionContextVoidMethodMethodCallback, 0, 0}, | 7575 {"callWithExecutionContextVoidMethod", TestObjectPythonV8Internal::callWithE xecutionContextVoidMethodMethodCallback, 0, 0}, |
7552 {"callWithScriptStateExecutionContextVoidMethod", TestObjectPythonV8Internal ::callWithScriptStateExecutionContextVoidMethodMethodCallback, 0, 0}, | 7576 {"callWithScriptStateExecutionContextVoidMethod", TestObjectPythonV8Internal ::callWithScriptStateExecutionContextVoidMethodMethodCallback, 0, 0}, |
7553 {"callWithScriptStateScriptArgumentsVoidMethod", TestObjectPythonV8Internal: :callWithScriptStateScriptArgumentsVoidMethodMethodCallback, 0, 0}, | 7577 {"callWithScriptStateScriptArgumentsVoidMethod", TestObjectPythonV8Internal: :callWithScriptStateScriptArgumentsVoidMethodMethodCallback, 0, 0}, |
7554 {"callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg", TestObjec tPythonV8Internal::callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanAr gMethodCallback, 0, 0}, | 7578 {"callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg", TestObjec tPythonV8Internal::callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanAr gMethodCallback, 0, 0}, |
7555 {"callWithActiveWindow", TestObjectPythonV8Internal::callWithActiveWindowMet hodCallback, 0, 0}, | 7579 {"callWithActiveWindow", TestObjectPythonV8Internal::callWithActiveWindowMet hodCallback, 0, 0}, |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7757 fromInternalPointer(object)->deref(); | 7781 fromInternalPointer(object)->deref(); |
7758 } | 7782 } |
7759 | 7783 |
7760 template<> | 7784 template<> |
7761 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate) | 7785 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate) |
7762 { | 7786 { |
7763 return toV8(impl, creationContext, isolate); | 7787 return toV8(impl, creationContext, isolate); |
7764 } | 7788 } |
7765 | 7789 |
7766 } // namespace WebCore | 7790 } // namespace WebCore |
OLD | NEW |