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

Unified Diff: third_party/WebKit/Source/core/testing/RecordTest.cpp

Issue 2709983004: WIP bindings: Add support for the record<K,V> WebIDL type. (Closed)
Patch Set: Rebased patch using NativeValueTraits for IDL types Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/testing/RecordTest.cpp
diff --git a/third_party/WebKit/Source/core/testing/RecordTest.cpp b/third_party/WebKit/Source/core/testing/RecordTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6285497c29f0e39faacf6ff2bf91b001e848567f
--- /dev/null
+++ b/third_party/WebKit/Source/core/testing/RecordTest.cpp
@@ -0,0 +1,70 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "RecordTest.h"
+
+namespace blink {
+
+RecordTest::RecordTest() {}
+
+RecordTest::~RecordTest() {}
+
+void RecordTest::setStringLongRecord(
+ const Vector<std::pair<String, int32_t>>& arg) {
+ m_stringLongRecord = arg;
+}
+
+Vector<std::pair<String, int32_t>> RecordTest::getStringLongRecord() {
+ return m_stringLongRecord;
+}
+
+void RecordTest::setNullableStringLongRecord(
+ const Nullable<Vector<std::pair<String, int32_t>>>& arg) {
+ m_nullableStringLongRecord = arg;
+}
+
+Nullable<Vector<std::pair<String, int32_t>>>
+RecordTest::getNullableStringLongRecord() {
+ return m_nullableStringLongRecord;
+}
+
+Vector<std::pair<String, String>> RecordTest::getByteStringByteStringRecord() {
+ return m_byteStringByteStringRecord;
+}
+
+void RecordTest::setByteStringByteStringRecord(
+ const Vector<std::pair<String, String>>& arg) {
+ m_byteStringByteStringRecord = arg;
+}
+
+void RecordTest::setStringElementRecord(
+ const HeapVector<std::pair<String, Member<Element>>>& arg) {
+ m_stringElementRecord = arg;
+}
+
+HeapVector<std::pair<String, Member<Element>>>
+RecordTest::getStringElementRecord() {
+ return m_stringElementRecord;
+}
+
+void RecordTest::setUSVStringUSVStringBooleanRecordRecord(
+ const RecordTest::NestedRecordType& arg) {
+ m_USVStringUSVStringBooleanRecordRecord = arg;
+}
+
+RecordTest::NestedRecordType
+RecordTest::getUSVStringUSVStringBooleanRecordRecord() {
+ return m_USVStringUSVStringBooleanRecordRecord;
+}
+
+bool RecordTest::unionReceivedARecord(
+ const BooleanOrByteStringByteStringRecord& arg) {
+ return arg.isByteStringByteStringRecord();
+}
+
+DEFINE_TRACE(RecordTest) {
+ visitor->trace(m_stringElementRecord);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698