OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "mojo/public/cpp/bindings/array.h" |
5 #include "third_party/WebKit/public/platform/WebVector.h" | 6 #include "third_party/WebKit/public/platform/WebVector.h" |
6 #include "third_party/mojo/src/mojo/public/cpp/bindings/array.h" | |
7 | 7 |
8 namespace mojo { | 8 namespace mojo { |
9 | 9 |
10 template <typename T, typename U> | 10 template <typename T, typename U> |
11 struct TypeConverter<Array<T>, blink::WebVector<U>> { | 11 struct TypeConverter<Array<T>, blink::WebVector<U>> { |
12 static Array<T> Convert(const blink::WebVector<U>& vector) { | 12 static Array<T> Convert(const blink::WebVector<U>& vector) { |
13 Array<T> array(vector.size()); | 13 Array<T> array(vector.size()); |
14 for (size_t i = 0; i < vector.size(); ++i) | 14 for (size_t i = 0; i < vector.size(); ++i) |
15 array[i] = TypeConverter<T, U>::Convert(vector[i]); | 15 array[i] = TypeConverter<T, U>::Convert(vector[i]); |
16 return array.Pass(); | 16 return array.Pass(); |
17 } | 17 } |
18 }; | 18 }; |
19 | 19 |
20 } // namespace mojo | 20 } // namespace mojo |
OLD | NEW |