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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "RecordTest.h"
6
7 namespace blink {
8
9 RecordTest::RecordTest() {}
10
11 RecordTest::~RecordTest() {}
12
13 void RecordTest::setStringLongRecord(
14 const Vector<std::pair<String, int32_t>>& arg) {
15 m_stringLongRecord = arg;
16 }
17
18 Vector<std::pair<String, int32_t>> RecordTest::getStringLongRecord() {
19 return m_stringLongRecord;
20 }
21
22 void RecordTest::setNullableStringLongRecord(
23 const Nullable<Vector<std::pair<String, int32_t>>>& arg) {
24 m_nullableStringLongRecord = arg;
25 }
26
27 Nullable<Vector<std::pair<String, int32_t>>>
28 RecordTest::getNullableStringLongRecord() {
29 return m_nullableStringLongRecord;
30 }
31
32 Vector<std::pair<String, String>> RecordTest::getByteStringByteStringRecord() {
33 return m_byteStringByteStringRecord;
34 }
35
36 void RecordTest::setByteStringByteStringRecord(
37 const Vector<std::pair<String, String>>& arg) {
38 m_byteStringByteStringRecord = arg;
39 }
40
41 void RecordTest::setStringElementRecord(
42 const HeapVector<std::pair<String, Member<Element>>>& arg) {
43 m_stringElementRecord = arg;
44 }
45
46 HeapVector<std::pair<String, Member<Element>>>
47 RecordTest::getStringElementRecord() {
48 return m_stringElementRecord;
49 }
50
51 void RecordTest::setUSVStringUSVStringBooleanRecordRecord(
52 const RecordTest::NestedRecordType& arg) {
53 m_USVStringUSVStringBooleanRecordRecord = arg;
54 }
55
56 RecordTest::NestedRecordType
57 RecordTest::getUSVStringUSVStringBooleanRecordRecord() {
58 return m_USVStringUSVStringBooleanRecordRecord;
59 }
60
61 Vector<std::pair<String, Vector<String>>>
62 RecordTest::returnStringByteStringSequenceRecord() {
63 Vector<std::pair<String, Vector<String>>> record;
64 Vector<String> innerVector1;
65 innerVector1.push_back("hello, world");
66 innerVector1.push_back("hi, mom");
67 record.push_back(std::make_pair(String("foo"), innerVector1));
68 Vector<String> innerVector2;
69 innerVector2.push_back("goodbye, mom");
70 record.push_back(std::make_pair(String("bar"), innerVector2));
71 return record;
72 }
73
74 bool RecordTest::unionReceivedARecord(
75 const BooleanOrByteStringByteStringRecord& arg) {
76 return arg.isByteStringByteStringRecord();
77 }
78
79 DEFINE_TRACE(RecordTest) {
80 visitor->trace(m_stringElementRecord);
81 }
82
83 } // namespace blink
OLDNEW
« 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