Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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 "config.h" | |
| 6 #include "DictionaryTest.h" | |
| 7 | |
| 8 #include "core/testing/TestingDictionary.h" | |
| 9 | |
| 10 namespace blink { | |
| 11 | |
| 12 DictionaryTest::DictionaryTest() | |
| 13 { | |
| 14 ScriptWrappable::init(this); | |
| 15 } | |
| 16 | |
| 17 DictionaryTest::~DictionaryTest() | |
| 18 { | |
| 19 } | |
| 20 | |
| 21 void DictionaryTest::set(const TestingDictionary* testingDictionary) | |
| 22 { | |
| 23 if (testingDictionary->hasLongMember()) | |
| 24 m_longMember = testingDictionary->longMember(); | |
| 25 m_stringMember = testingDictionary->stringMember(); | |
|
haraken
2014/08/26 04:00:40
Just help me understand: Are you assuming that Dic
bashi
2014/08/27 05:06:32
It depends on whether a member has a default value
| |
| 26 if (testingDictionary->hasBooleanOrNullMember()) | |
| 27 m_booleanOrNullMember = testingDictionary->booleanOrNullMember(); | |
| 28 if (testingDictionary->hasStringSequenceMember()) | |
| 29 m_stringSequenceMember = testingDictionary->stringSequenceMember(); | |
| 30 } | |
| 31 | |
| 32 TestingDictionary* DictionaryTest::get() | |
| 33 { | |
| 34 TestingDictionary* result = TestingDictionary::create(); | |
| 35 if (m_longMember) | |
| 36 result->setLongMember(m_longMember.get()); | |
| 37 result->setStringMember(m_stringMember); | |
| 38 if (m_booleanOrNullMember) | |
| 39 result->setBooleanOrNullMember(m_booleanOrNullMember); | |
| 40 result->setStringSequenceMember(m_stringSequenceMember); | |
|
haraken
2014/08/26 04:00:40
Ditto. It's not clear to me when the Dictionary us
bashi
2014/08/27 05:06:32
It depends on how the dictionary is defined and th
| |
| 41 return result; | |
| 42 } | |
| 43 | |
| 44 void DictionaryTest::trace(Visitor* visitor) | |
|
haraken
2014/08/26 04:00:40
Drop |visitor|.
bashi
2014/08/27 05:06:32
Done.
| |
| 45 { | |
| 46 } | |
| 47 | |
| 48 } | |
| OLD | NEW |