Index: mojo/public/cpp/bindings/lib/bindings_internal.h |
diff --git a/mojo/public/cpp/bindings/lib/bindings_internal.h b/mojo/public/cpp/bindings/lib/bindings_internal.h |
index 6f73ee6a16c180dd7aae7f418986816ce09c294b..f761145c31f27d13e08241dda0be2a5f0d6b8c68 100644 |
--- a/mojo/public/cpp/bindings/lib/bindings_internal.h |
+++ b/mojo/public/cpp/bindings/lib/bindings_internal.h |
@@ -10,6 +10,7 @@ |
#include <functional> |
#include <type_traits> |
+#include "mojo/public/cpp/bindings/enum_traits.h" |
#include "mojo/public/cpp/bindings/interface_id.h" |
#include "mojo/public/cpp/bindings/lib/template_util.h" |
#include "mojo/public/cpp/system/core.h" |
@@ -330,6 +331,14 @@ struct EnumHashImpl { |
} |
}; |
+template <typename MojomType, typename T> |
+T ConvertEnumValue(MojomType input) { |
+ T output; |
+ bool result = EnumTraits<MojomType, T>::FromMojom(input, &output); |
+ DCHECK(result); |
+ return output; |
+} |
+ |
} // namespace internal |
} // namespace mojo |