| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BluetoothStructTraits_h | 5 #ifndef BluetoothStructTraits_h |
| 6 #define BluetoothStructTraits_h | 6 #define BluetoothStructTraits_h |
| 7 | 7 |
| 8 #include "device/bluetooth/public/interfaces/uuid.mojom-blink.h" | 8 #include "device/bluetooth/public/interfaces/uuid.mojom-blink.h" |
| 9 #include "platform/wtf/text/WTFString.h" |
| 9 #include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" | 10 #include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" |
| 10 #include "wtf/text/WTFString.h" | |
| 11 | 11 |
| 12 namespace mojo { | 12 namespace mojo { |
| 13 | 13 |
| 14 template <> | 14 template <> |
| 15 struct StructTraits<::blink::mojom::WebBluetoothDeviceIdDataView, WTF::String> { | 15 struct StructTraits<::blink::mojom::WebBluetoothDeviceIdDataView, WTF::String> { |
| 16 static const WTF::String& device_id(const WTF::String& input) { | 16 static const WTF::String& device_id(const WTF::String& input) { |
| 17 return input; | 17 return input; |
| 18 } | 18 } |
| 19 | 19 |
| 20 static bool Read(::blink::mojom::WebBluetoothDeviceIdDataView, | 20 static bool Read(::blink::mojom::WebBluetoothDeviceIdDataView, |
| 21 WTF::String* output); | 21 WTF::String* output); |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 template <> | 24 template <> |
| 25 struct StructTraits<bluetooth::mojom::UUIDDataView, WTF::String> { | 25 struct StructTraits<bluetooth::mojom::UUIDDataView, WTF::String> { |
| 26 static const WTF::String& uuid(const WTF::String& input) { return input; } | 26 static const WTF::String& uuid(const WTF::String& input) { return input; } |
| 27 | 27 |
| 28 static bool Read(bluetooth::mojom::UUIDDataView, WTF::String* output); | 28 static bool Read(bluetooth::mojom::UUIDDataView, WTF::String* output); |
| 29 | 29 |
| 30 static bool IsNull(const WTF::String& input) { return input.isNull(); } | 30 static bool IsNull(const WTF::String& input) { return input.isNull(); } |
| 31 | 31 |
| 32 static void SetToNull(WTF::String* output); | 32 static void SetToNull(WTF::String* output); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 } // namespace mojo | 35 } // namespace mojo |
| 36 | 36 |
| 37 #endif // BluetoothStructTraits_h | 37 #endif // BluetoothStructTraits_h |
| OLD | NEW |