OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef BluetoothUUIDTraits_h | |
6 #define BluetoothUUIDTraits_h | |
7 | |
8 #include "device/bluetooth/public/interfaces/uuid.mojom-blink.h" | |
9 #include "wtf/text/WTFString.h" | |
10 | |
11 namespace mojo { | |
12 | |
13 template <> | |
14 struct StructTraits<bluetooth::mojom::blink::UUID::DataView, WTF::String> { | |
15 static const WTF::String& uuid(const WTF::String& input) { return input; } | |
16 | |
17 static bool Read(bluetooth::mojom::blink::UUID::DataView data, | |
18 WTF::String* output) { | |
19 StringDataView view; | |
20 data.GetUuidDataView(&view); | |
21 *output = WTF::String(reinterpret_cast<const UChar*>(view.storage()), | |
dcheng
2016/12/29 08:58:06
Can this just be:
return data.ReadUuid(output);
juncai
2016/12/29 22:22:59
Done.
| |
22 view.size()); | |
23 return true; | |
24 } | |
25 }; | |
26 | |
27 } // namespace mojo | |
28 | |
29 #endif // BluetoothUUIDTraits_h | |
OLD | NEW |