Chromium Code Reviews| Index: services/preferences/public/cpp/preferences_struct_traits_macros.h |
| diff --git a/services/preferences/public/cpp/preferences_struct_traits_macros.h b/services/preferences/public/cpp/preferences_struct_traits_macros.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2b3429f162a7db01d554d778c21757a4a6ea1581 |
| --- /dev/null |
| +++ b/services/preferences/public/cpp/preferences_struct_traits_macros.h |
| @@ -0,0 +1,26 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
|
Sam McNally
2017/03/07 01:47:13
Delete.
tibell
2017/03/07 02:44:15
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef SERVICES_PREFERENCES_PUBLIC_CPP_PREFERENCES_STRUCT_TRAITS_MACROS_H_ |
| +#define SERVICES_PREFERENCES_PUBLIC_CPP_PREFERENCES_STRUCT_TRAITS_MACROS_H_ |
| + |
| +#include "components/prefs/pref_value_store.h" |
| +#include "mojo/public/cpp/bindings/enum_traits.h" |
| +#include "services/preferences/public/interfaces/preferences.mojom-shared.h" |
| + |
| +namespace mojo { |
| + |
| +template <> |
| +struct EnumTraits<::prefs::mojom::PrefStoreType, |
| + ::PrefValueStore::PrefStoreType> { |
| + static prefs::mojom::PrefStoreType ToMojom( |
| + PrefValueStore::PrefStoreType input); |
| + |
| + static bool FromMojom(prefs::mojom::PrefStoreType input, |
| + PrefValueStore::PrefStoreType* output); |
| +}; |
| + |
| +} // namespace mojo |
| + |
| +#endif // SERVICES_PREFERENCES_PUBLIC_CPP_PREFERENCES_STRUCT_TRAITS_MACROS_H_ |