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

Unified Diff: Source/core/dom/SomeDictionaryUser.cpp

Issue 386963003: [WIP][NotForLand] IDL dictionary support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: sequence and array support Created 6 years, 5 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
« no previous file with comments | « Source/core/dom/SomeDictionaryUser.h ('k') | Source/core/dom/SomeDictionaryUser.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e768e82f4026869e96b84ed958a49cb6f6b0c190
--- /dev/null
+++ b/Source/core/dom/SomeDictionaryUser.cpp
@@ -0,0 +1,46 @@
+// NOT FOR LAND
+#include "config.h"
+#include "SomeDictionaryUser.h"
+
+namespace WebCore {
+
+SomeDictionaryUser::SomeDictionaryUser()
+ : m_a(0)
+ , m_b(2)
+{
+ ScriptWrappable::init(this);
+}
+
+SomeDictionaryUser::~SomeDictionaryUser()
+{
+}
+
+void SomeDictionaryUser::set(const SomeDictionary* someDictionary)
+{
+ if (someDictionary->hasA())
+ m_a = someDictionary->a();
+ m_b = someDictionary->b();
+ m_stringMember = someDictionary->stringMember();
+ m_element = someDictionary->element();
+ if (someDictionary->hasNullableBooleanMember())
+ m_nullableBooleanMember = someDictionary->nullableBooleanMember();
+ m_stringSequenceMember = someDictionary->stringSequenceMember();
+ m_elementArrayMember = someDictionary->elementArrayMember();
+}
+
+SomeDictionary* SomeDictionaryUser::get()
+{
+ SomeDictionary* result = SomeDictionary::create();
+ if (m_a)
+ result->setA(m_a.get());
+ result->setB(m_b);
+ result->setStringMember(m_stringMember);
+ result->setElement(m_element);
+ if (m_nullableBooleanMember)
+ result->setNullableBooleanMember(m_nullableBooleanMember);
+ result->setStringSequenceMember(m_stringSequenceMember);
+ result->setElementArrayMember(m_elementArrayMember);
+ return result;
+}
+
+}
« no previous file with comments | « Source/core/dom/SomeDictionaryUser.h ('k') | Source/core/dom/SomeDictionaryUser.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698