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

Unified Diff: Source/bindings/tests/results/V8TestObjectPython.cpp

Issue 204213002: Replace custom EventTarget toNative call with [ToNativeArg] extended attribute Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/tests/idls/TestObjectPython.idl ('k') | Source/core/events/EventTarget.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestObjectPython.cpp
diff --git a/Source/bindings/tests/results/V8TestObjectPython.cpp b/Source/bindings/tests/results/V8TestObjectPython.cpp
index 0223e130b1a927a6deb34f33bd94eeddf5636441..db961d0167d120f89e4e2e95a1eb4d70d40738df 100644
--- a/Source/bindings/tests/results/V8TestObjectPython.cpp
+++ b/Source/bindings/tests/results/V8TestObjectPython.cpp
@@ -78,6 +78,7 @@
#include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h"
#include "core/dom/custom/CustomElementCallbackDispatcher.h"
+#include "core/frame/DOMWindow.h"
#include "core/frame/UseCounter.h"
#include "core/inspector/ScriptArguments.h"
#include "platform/TraceEvent.h"
@@ -6433,6 +6434,28 @@ static void voidMethodEnforceRangeLongArgMethodCallback(const v8::FunctionCallba
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
+static void voidMethodToNativeArgEventListenerArgMethod(const v8::FunctionCallbackInfo<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
+{
+ if (UNLIKELY(info.Length() < 1)) {
+ throwTypeError(ExceptionMessages::failedToExecute("voidMethodToNativeArgEventListenerArg", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ return;
+ }
+ TestObjectPython* impl = V8TestObjectPython::toNative(info.Holder());
+ if (info.Length() <= 0 || !info[0]->IsFunction()) {
+ throwTypeError(ExceptionMessages::failedToExecute("voidMethodToNativeArgEventListenerArg", "TestObjectPython", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
+ return;
+ }
+ OwnPtr<EventListener> listener = V8EventListener::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
+ impl->voidMethodToNativeArgEventListenerArg(listener.release());
+}
+
+static void voidMethodToNativeArgEventListenerArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+ TestObjectPythonV8Internal::voidMethodToNativeArgEventListenerArgMethod(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
+}
+
static void voidMethodTreatNullAsNullStringStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
@@ -7543,6 +7566,7 @@ static const V8DOMConfiguration::MethodConfiguration V8TestObjectPythonMethods[]
{"voidMethodDefaultUndefinedStringArg", TestObjectPythonV8Internal::voidMethodDefaultUndefinedStringArgMethodCallback, 0, 0},
{"voidMethodDefaultNullStringStringArg", TestObjectPythonV8Internal::voidMethodDefaultNullStringStringArgMethodCallback, 0, 0},
{"voidMethodEnforceRangeLongArg", TestObjectPythonV8Internal::voidMethodEnforceRangeLongArgMethodCallback, 0, 1},
+ {"voidMethodToNativeArgEventListenerArg", TestObjectPythonV8Internal::voidMethodToNativeArgEventListenerArgMethodCallback, 0, 1},
{"voidMethodTreatNullAsNullStringStringArg", TestObjectPythonV8Internal::voidMethodTreatNullAsNullStringStringArgMethodCallback, 0, 1},
{"voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg", TestObjectPythonV8Internal::voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMethodCallback, 0, 1},
{"activityLoggingAccessForAllWorldsMethod", TestObjectPythonV8Internal::activityLoggingAccessForAllWorldsMethodMethodCallback, 0, 0},
« no previous file with comments | « Source/bindings/tests/idls/TestObjectPython.idl ('k') | Source/core/events/EventTarget.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698