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

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

Issue 386963003: [WIP][NotForLand] IDL dictionary support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: sequence and array support Created 6 years, 5 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/results/V8TestDictionary.cpp ('k') | Source/core/core.gyp » ('j') | 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 0c23f1fbd2adbd621765845a91236742ae130346..aa5cb78b9efcbda1f904f523e3f42fb6b74d6377 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"
@@ -6837,6 +6838,69 @@ static void voidMethodTestEnumArgMethodCallback(const v8::FunctionCallbackInfo<v
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
+static void testDictionaryMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TestObject* impl = V8TestObject::toNative(info.Holder());
+ v8SetReturnValue(info, impl->testDictionaryMethod());
+}
+
+static void testDictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
+ TestObjectV8Internal::testDictionaryMethodMethod(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
+}
+
+static void voidMethodTestDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ if (UNLIKELY(info.Length() < 1)) {
+ throwMinimumArityTypeErrorForMethod("voidMethodTestDictionaryArg", "TestObject", 1, info.Length(), info.GetIsolate());
+ return;
+ }
+ TestObject* impl = V8TestObject::toNative(info.Holder());
+ TestDictionary* testDictionaryArg;
+ {
+ v8::TryCatch block;
+ V8RethrowTryCatchScope rethrow(block);
+ if (!info[0]->IsUndefined()) {
+ TONATIVE_VOID_INTERNAL(testDictionaryArg, V8TestDictionary::toNative(info.GetIsolate(), info[0]));
+ } else {
+ testDictionaryArg = TestDictionary::create();
+ }
+ }
+ impl->voidMethodTestDictionaryArg(testDictionaryArg);
+}
+
+static void voidMethodTestDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
+ TestObjectV8Internal::voidMethodTestDictionaryArgMethod(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
+}
+
+static void voidMethodOptionalTestDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TestObject* impl = V8TestObject::toNative(info.Holder());
+ TestDictionary* optionalTestDictionaryArg;
+ {
+ v8::TryCatch block;
+ V8RethrowTryCatchScope rethrow(block);
+ if (!info[0]->IsUndefined()) {
+ TONATIVE_VOID_INTERNAL(optionalTestDictionaryArg, V8TestDictionary::toNative(info.GetIsolate(), info[0]));
+ } else {
+ optionalTestDictionaryArg = TestDictionary::create();
+ }
+ }
+ impl->voidMethodOptionalTestDictionaryArg(optionalTestDictionaryArg);
+}
+
+static void voidMethodOptionalTestDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
+ TestObjectV8Internal::voidMethodOptionalTestDictionaryArgMethod(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
+}
+
static void dictionaryMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObject* impl = V8TestObject::toNative(info.Holder());
@@ -10695,6 +10759,9 @@ static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = {
{"voidMethodTestCallbackInterfaceOrNullArg", TestObjectV8Internal::voidMethodTestCallbackInterfaceOrNullArgMethodCallback, 0, 1},
{"testEnumMethod", TestObjectV8Internal::testEnumMethodMethodCallback, 0, 0},
{"voidMethodTestEnumArg", TestObjectV8Internal::voidMethodTestEnumArgMethodCallback, 0, 1},
+ {"testDictionaryMethod", TestObjectV8Internal::testDictionaryMethodMethodCallback, 0, 0},
+ {"voidMethodTestDictionaryArg", TestObjectV8Internal::voidMethodTestDictionaryArgMethodCallback, 0, 1},
+ {"voidMethodOptionalTestDictionaryArg", TestObjectV8Internal::voidMethodOptionalTestDictionaryArgMethodCallback, 0, 0},
{"dictionaryMethod", TestObjectV8Internal::dictionaryMethodMethodCallback, 0, 0},
{"nodeFilterMethod", TestObjectV8Internal::nodeFilterMethodMethodCallback, 0, 0},
{"promiseMethod", TestObjectV8Internal::promiseMethodMethodCallback, 0, 0},
« no previous file with comments | « Source/bindings/tests/results/V8TestDictionary.cpp ('k') | Source/core/core.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698