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

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

Issue 2732093003: bindings: Add support for the record<K,V> WebIDL type. (Closed)
Patch Set: s/isolate->GetCurrentContext()/context/ Created 3 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
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..f4e79e645a00c0b7ce1025316a05eb355702fdd8
--- /dev/null
+++ b/third_party/WebKit/Source/core/testing/RecordTest.cpp
@@ -0,0 +1,83 @@
+// 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;
+}
+
+Vector<std::pair<String, Vector<String>>>
+RecordTest::returnStringByteStringSequenceRecord() {
+ Vector<std::pair<String, Vector<String>>> record;
+ Vector<String> innerVector1;
+ innerVector1.push_back("hello, world");
+ innerVector1.push_back("hi, mom");
+ record.push_back(std::make_pair(String("foo"), innerVector1));
+ Vector<String> innerVector2;
+ innerVector2.push_back("goodbye, mom");
+ record.push_back(std::make_pair(String("bar"), innerVector2));
+ return record;
+}
+
+bool RecordTest::unionReceivedARecord(
+ const BooleanOrByteStringByteStringRecord& arg) {
+ return arg.isByteStringByteStringRecord();
+}
+
+DEFINE_TRACE(RecordTest) {
+ visitor->trace(m_stringElementRecord);
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/testing/RecordTest.h ('k') | third_party/WebKit/Source/core/testing/RecordTest.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698