Chromium Code Reviews| Index: Source/core/dom/SomeDictionaryUser.cpp |
| diff --git a/Source/core/dom/SomeDictionaryUser.cpp b/Source/core/dom/SomeDictionaryUser.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e617c3e64beaafefc6e198af1f298e513825d33e |
| --- /dev/null |
| +++ b/Source/core/dom/SomeDictionaryUser.cpp |
| @@ -0,0 +1,41 @@ |
| +// NOT FOR LAND |
| +#include "config.h" |
| +#include "SomeDictionaryUser.h" |
| + |
| +namespace WebCore { |
| + |
| +SomeDictionaryUser::SomeDictionaryUser() |
| + : m_a(0) |
| + , m_hasA(false) |
| + , m_b(0) |
|
haraken
2014/07/21 16:11:59
This should be m_b(2). The default value of m_b is
bashi
2014/07/22 02:33:58
Yes. But actually, there is no need for the defaul
|
| +{ |
| + ScriptWrappable::init(this); |
| +} |
| + |
| +SomeDictionaryUser::~SomeDictionaryUser() |
| +{ |
| +} |
| + |
| +void SomeDictionaryUser::set(const SomeDictionary* someDictionary) |
| +{ |
| + if (someDictionary->hasA()) { |
| + m_a = someDictionary->a(); |
| + m_hasA = true; |
| + } |
| + m_b = someDictionary->b(); |
| + m_stringMember = someDictionary->stringMember(); |
| + m_element = someDictionary->element(); |
| +} |
| + |
| +SomeDictionary* SomeDictionaryUser::get() |
| +{ |
| + SomeDictionary* result = SomeDictionary::create(); |
| + if (m_hasA) |
| + result->setA(m_a); |
| + result->setB(m_b); |
|
haraken
2014/07/21 16:11:59
If introducing m_hasB makes things more consistent
bashi
2014/07/22 02:33:58
Yes. I should have introduced m_hasB for consisten
|
| + result->setStringMember(m_stringMember); |
| + result->setElement(m_element); |
| + return result; |
| +} |
| + |
| +} |