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

Unified Diff: Source/bindings/v8/Dictionary.h

Issue 74533003: Add Perl IDL support for method parameter type sequence<Dictionary> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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: Source/bindings/v8/Dictionary.h
diff --git a/Source/bindings/v8/Dictionary.h b/Source/bindings/v8/Dictionary.h
index 27fea21e3156d98c2064dbaae22229f5a1a8f00e..fa96f4e165c77299bd9845e736a415d6b1faf308 100644
--- a/Source/bindings/v8/Dictionary.h
+++ b/Source/bindings/v8/Dictionary.h
@@ -112,6 +112,36 @@ private:
v8::Isolate* m_isolate;
};
+class DictionarySequence {
+public:
+ DictionarySequence()
+ : m_length(0)
+ , m_isolate(0)
+ {
+ }
+
+ DictionarySequence(v8::Local<v8::Object> list, size_t length, v8::Isolate* isolate)
+ : m_list(list)
+ , m_length(length)
+ , m_isolate(isolate)
+ {
+ }
+
+ size_t length() const { return m_length; }
+ Dictionary operator[](size_t i) const
+ {
+ if (i < m_length)
+ return Dictionary(m_list->Get(i), m_isolate);
+ ASSERT_NOT_REACHED();
+ return Dictionary();
+ }
+
+private:
+ v8::Local<v8::Object> m_list;
+ size_t m_length;
+ v8::Isolate* m_isolate;
+};
+
}
#endif // Dictionary_h

Powered by Google App Engine
This is Rietveld 408576698