| 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_
|
|
|