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

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

Issue 474813004: IDL: Fix overload resolution for dictionary types (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: the fix Created 6 years, 4 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/TestObject.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestObject.cpp
diff --git a/Source/bindings/tests/results/V8TestObject.cpp b/Source/bindings/tests/results/V8TestObject.cpp
index cca5261d6660a57a4b02eb649d1c00a36d9544d1..e9738ee98a0478931891063fa67280f73b1d016b 100644
--- a/Source/bindings/tests/results/V8TestObject.cpp
+++ b/Source/bindings/tests/results/V8TestObject.cpp
@@ -39,6 +39,7 @@
#include "bindings/tests/v8/V8NodeFilter.h"
#include "bindings/tests/v8/V8ShadowRoot.h"
#include "bindings/tests/v8/V8TestCallbackInterface.h"
+#include "bindings/tests/v8/V8TestDictionary.h"
#include "bindings/tests/v8/V8TestInterface.h"
#include "bindings/tests/v8/V8TestInterfaceEmpty.h"
#include "bindings/tests/v8/V8TestInterfaceGarbageCollected.h"
@@ -8171,6 +8172,58 @@ static void overloadedMethodIMethodCallback(const v8::FunctionCallbackInfo<v8::V
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
+static void overloadedMethodJ1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TestObject* impl = V8TestObject::toNative(info.Holder());
+ V8StringResource<> stringArg;
+ {
+ TOSTRING_VOID_INTERNAL(stringArg, info[0]);
+ }
+ impl->overloadedMethodJ(stringArg);
+}
+
+static void overloadedMethodJ2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TestObject* impl = V8TestObject::toNative(info.Holder());
+ TestDictionary* testDictionaryArg;
+ {
+ v8::TryCatch block;
+ V8RethrowTryCatchScope rethrow(block);
+ TONATIVE_VOID_INTERNAL(testDictionaryArg, V8TestDictionary::toNative(info.GetIsolate(), info[0]));
+ }
+ impl->overloadedMethodJ(testDictionaryArg);
+}
+
+static void overloadedMethodJMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodJ", "TestObject", info.Holder(), info.GetIsolate());
+ switch (std::min(1, info.Length())) {
+ case 1:
+ if (info[0]->IsObject()) {
+ overloadedMethodJ2Method(info);
+ return;
+ }
+ if (true) {
+ overloadedMethodJ1Method(info);
+ return;
+ }
+ break;
+ default:
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+ exceptionState.throwIfNeeded();
+ return;
+ }
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
+}
+
+static void overloadedMethodJMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
+ TestObjectV8Internal::overloadedMethodJMethod(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
+}
+
static void overloadedPerWorldBindingsMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObject* impl = V8TestObject::toNative(info.Holder());
@@ -10474,6 +10527,7 @@ static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = {
{"overloadedMethodG", TestObjectV8Internal::overloadedMethodGMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
{"overloadedMethodH", TestObjectV8Internal::overloadedMethodHMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
{"overloadedMethodI", TestObjectV8Internal::overloadedMethodIMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
+ {"overloadedMethodJ", TestObjectV8Internal::overloadedMethodJMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
{"overloadedPerWorldBindingsMethod", TestObjectV8Internal::overloadedPerWorldBindingsMethodMethodCallback, TestObjectV8Internal::overloadedPerWorldBindingsMethodMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAllScripts},
{"voidMethodClampUnsignedShortArg", TestObjectV8Internal::voidMethodClampUnsignedShortArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
{"voidMethodClampUnsignedLongArg", TestObjectV8Internal::voidMethodClampUnsignedLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
« no previous file with comments | « Source/bindings/tests/idls/TestObject.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698