Chromium Code Reviews| Index: third_party/WebKit/Source/modules/vr/VRTypeConverters.h |
| diff --git a/third_party/WebKit/Source/modules/vr/VRTypeConverters.h b/third_party/WebKit/Source/modules/vr/VRTypeConverters.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..32aba763e616657e913460805e5a5ceaa4b88ea7 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/vr/VRTypeConverters.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
dcheng
2016/04/28 19:59:44
Let's not add new type converters. Can we add Stru
RaviKasibhatla
2016/04/29 14:49:05
I am checking at the possibility of using mojom ty
RaviKasibhatla
2016/05/03 14:34:21
@dcheng:
By StructTraits, are you referring to the
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef VRTypeConverters_h |
| +#define VRTypeConverters_h |
| + |
| +#include "mojo/public/cpp/bindings/type_converter.h" |
| +#include "public/platform/modules/vr/WebVR.h" |
| +#include "public/platform/modules/vr/vr_service.mojom.h" |
| + |
| +namespace mojo { |
| + |
| +// Type/enum conversions from WebVR data types to Mojo data types |
| +// and vice versa. |
| + |
| +template <> |
| +struct TypeConverter<blink::WebVRVector3, blink::mojom::VRVector3Ptr> { |
| + static blink::WebVRVector3 Convert(const blink::mojom::VRVector3Ptr& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<blink::WebVRVector4, blink::mojom::VRVector4Ptr> { |
| + static blink::WebVRVector4 Convert(const blink::mojom::VRVector4Ptr& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<blink::WebVRRect, blink::mojom::VRRectPtr> { |
| + static blink::WebVRRect Convert(const blink::mojom::VRRectPtr& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<blink::WebVRFieldOfView, blink::mojom::VRFieldOfViewPtr> { |
| + static blink::WebVRFieldOfView Convert( |
| + const blink::mojom::VRFieldOfViewPtr& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<blink::WebVREyeParameters, blink::mojom::VREyeParametersPtr> { |
| + static blink::WebVREyeParameters Convert( |
| + const blink::mojom::VREyeParametersPtr& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<blink::WebVRHMDInfo, blink::mojom::VRHMDInfoPtr> { |
| + static blink::WebVRHMDInfo Convert(const blink::mojom::VRHMDInfoPtr& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<blink::WebVRDevice, blink::mojom::VRDeviceInfoPtr> { |
| + static blink::WebVRDevice Convert(const blink::mojom::VRDeviceInfoPtr& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<blink::WebHMDSensorState, blink::mojom::VRSensorStatePtr> { |
| + static blink::WebHMDSensorState Convert( |
| + const blink::mojom::VRSensorStatePtr& input); |
| +}; |
| + |
| +} // namespace mojo |
| + |
| +#endif // VRTypeConverters_h |