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

Unified Diff: content/child/mojo/type_converters.h

Issue 1404213004: Reland: Add webusb permission bubble mojom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webusb_permission_ui_1_refactor_permission_bubble_manager
Patch Set: updated webusb.gypi dependencies again Created 5 years, 2 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 | « components/webusb/public/interfaces/webusb_permission_bubble.mojom ('k') | content/content_child.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/mojo/type_converters.h
diff --git a/content/child/mojo/type_converters.h b/content/child/mojo/type_converters.h
new file mode 100644
index 0000000000000000000000000000000000000000..37a5e5a523a1b176cc2c71275c4788086667bf97
--- /dev/null
+++ b/content/child/mojo/type_converters.h
@@ -0,0 +1,20 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "third_party/WebKit/public/platform/WebVector.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/array.h"
+
+namespace mojo {
+
+template <typename T, typename U>
+struct TypeConverter<Array<T>, blink::WebVector<U>> {
+ static Array<T> Convert(const blink::WebVector<U>& vector) {
+ Array<T> array(vector.size());
+ for (size_t i = 0; i < vector.size(); ++i)
+ array[i] = TypeConverter<T, U>::Convert(vector[i]);
+ return array.Pass();
+ }
+};
+
+} // namespace mojo
« no previous file with comments | « components/webusb/public/interfaces/webusb_permission_bubble.mojom ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698