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

Unified Diff: media/mojo/services/mojo_type_trait.h

Issue 763883006: Add Mojo CDM Service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years 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
« media/mojo/DEPS ('K') | « media/mojo/services/mojo_cdm_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_type_trait.h
diff --git a/media/mojo/services/mojo_type_trait.h b/media/mojo/services/mojo_type_trait.h
new file mode 100644
index 0000000000000000000000000000000000000000..e76264d6727c69e9feb134b904b7d7d70f90ba69
--- /dev/null
+++ b/media/mojo/services/mojo_type_trait.h
@@ -0,0 +1,32 @@
+// Copyright 2014 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.
+
+#ifndef MEDIA_MOJO_SERVICES_MOJO_TYPE_TRAIT_H_
+#define MEDIA_MOJO_SERVICES_MOJO_TYPE_TRAIT_H_
+
+#include "media/base/media_keys.h"
+#include "mojo/public/cpp/bindings/array.h"
+#include "mojo/public/cpp/bindings/string.h"
+
+namespace media {
+
+// A trait class to help get the corresponding mojo type for a native type.
+template <typename T>
+class MojoTypeTrait {};
+
+template <>
+struct MojoTypeTrait<std::string> {
+ typedef mojo::String MojoType;
+ static MojoType DefaultValue() { return MojoType(); }
+};
+
+template <>
+struct MojoTypeTrait<KeyIdsVector> {
+ typedef mojo::Array<mojo::Array<uint8_t>> MojoType;
+ static MojoType DefaultValue() { return MojoType(); }
+};
+
+} // namespace media
+
+#endif // MEDIA_MOJO_SERVICES_MOJO_TYPE_TRAIT_H_
« media/mojo/DEPS ('K') | « media/mojo/services/mojo_cdm_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698