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

Unified Diff: mojo/public/cpp/bindings/array.h

Issue 2008193002: Change mojo geometry structs from using type converters to StructTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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: mojo/public/cpp/bindings/array.h
diff --git a/mojo/public/cpp/bindings/array.h b/mojo/public/cpp/bindings/array.h
index d94feb0768c9ce6293c238d7562273b22ab7bc1b..8fb66097d98bca4c082825150e2cd8c0bbe2930b 100644
--- a/mojo/public/cpp/bindings/array.h
+++ b/mojo/public/cpp/bindings/array.h
@@ -49,6 +49,9 @@ class Array {
explicit Array(size_t size) : vec_(size), is_null_(false) {}
~Array() {}
+ // Copies the contents of |other| into this array.
+ Array(const std::vector<T>& other) : vec_(other), is_null_(false) {}
+
// Moves the contents of |other| into this array.
Array(std::vector<T>&& other) : vec_(std::move(other)), is_null_(false) {}
Array(Array&& other) : is_null_(true) { Take(&other); }

Powered by Google App Engine
This is Rietveld 408576698