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

Unified Diff: Source/WebCore/bindings/dart/DartDOMWrapper.h

Issue 9808037: Proper support for sequence<T> in IDLs. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/bindings/dart/DartDOMWrapper.h
diff --git a/Source/WebCore/bindings/dart/DartDOMWrapper.h b/Source/WebCore/bindings/dart/DartDOMWrapper.h
index 9a7fc95d7e60ad669db23945a33eb67e64bcc42e..3ef436593b0d28a69822cef612c944e3a254f885 100644
--- a/Source/WebCore/bindings/dart/DartDOMWrapper.h
+++ b/Source/WebCore/bindings/dart/DartDOMWrapper.h
@@ -204,36 +204,26 @@ Dart_Handle toDartValue(PassRefPtr< SVGAnimatedEnumerationPropertyTearOff<T> >)
return 0;
}
-template <class Element>
-inline Dart_Handle vectorToDartList(const Vector< RefPtr<Element> >& vector)
+template<typename T>
+Dart_Handle toDartValue(const Vector<T>& vector)
{
Dart_Handle list = Dart_NewList(vector.size());
if (Dart_IsError(list))
return list;
for (size_t i = 0; i < vector.size(); i++) {
- Dart_Handle result = Dart_ListSetAt(list, i, toDartValue(vector[i].get()));
+ Dart_Handle result = Dart_ListSetAt(list, i, toDartValue(vector[i]));
if (Dart_IsError(result))
return result;
}
return list;
}
-template <class Element>
-inline Dart_Handle vectorToDartList(const Vector<Element>& vector)
+// FIXME: provide specialization for PassRefPtr as well
podivilov 2012/03/23 15:44:12 We are generating toDartValue(PassRefPtr<T>) to gu
Anton Muhin 2012/03/23 17:29:23 Thanks a lot for bringing this. I still hope that
podivilov 2012/03/26 09:45:07 DartArrayBuffer.h generated header looks like this
+// and do not generate it.
+template<typename T>
+Dart_Handle toDartValue(RefPtr<T> value)
{
- // FIXME: create list from vector for primitive types
- // without element-by-element copying and conversion.
- // Need VM support.
- Dart_Handle list = Dart_NewList(vector.size());
- if (Dart_IsError(list))
- return list;
-
- for (size_t i = 0; i < vector.size(); i++) {
- Dart_Handle result = Dart_ListSetAt(list, i, toDartValue(vector[i]));
- if (Dart_IsError(result))
- return result;
- }
- return list;
+ return toDartValue(value.get());
}
template <class Element>

Powered by Google App Engine
This is Rietveld 408576698