OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BluetoothUUID_h | 5 #ifndef BluetoothUUID_h |
6 #define BluetoothUUID_h | 6 #define BluetoothUUID_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "bindings/modules/v8/StringOrUnsignedLong.h" | 9 #include "bindings/modules/v8/StringOrUnsignedLong.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 #include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" |
| 12 #include "wtf/text/WTFString.h" |
11 | 13 |
12 namespace blink { | 14 namespace blink { |
13 | 15 |
14 class ExceptionState; | 16 class ExceptionState; |
15 | 17 |
16 // This class provides a way for script to look up UUIDs by name so they don't | 18 // This class provides a way for script to look up UUIDs by name so they don't |
17 // need to be replicated in each application. | 19 // need to be replicated in each application. |
18 class BluetoothUUID final : public GarbageCollected<BluetoothUUID>, | 20 class BluetoothUUID final : public GarbageCollected<BluetoothUUID>, |
19 public ScriptWrappable { | 21 public ScriptWrappable { |
20 DEFINE_WRAPPERTYPEINFO(); | 22 DEFINE_WRAPPERTYPEINFO(); |
21 | 23 |
22 public: | 24 public: |
23 // IDL exposed interface: | 25 // IDL exposed interface: |
24 static String getService(StringOrUnsignedLong name, ExceptionState&); | 26 static String getService(StringOrUnsignedLong name, ExceptionState&); |
25 static String getCharacteristic(StringOrUnsignedLong name, ExceptionState&); | 27 static String getCharacteristic(StringOrUnsignedLong name, ExceptionState&); |
26 static String getDescriptor(StringOrUnsignedLong name, ExceptionState&); | 28 static String getDescriptor(StringOrUnsignedLong name, ExceptionState&); |
27 static String canonicalUUID(unsigned alias); | 29 static String canonicalUUID(unsigned alias); |
28 | 30 |
| 31 static bluetooth::mojom::blink::UUIDPtr createMojoUuid(const String& uuid); |
| 32 |
29 // Interface required by garbage collection. | 33 // Interface required by garbage collection. |
30 DEFINE_INLINE_TRACE() {} | 34 DEFINE_INLINE_TRACE() {} |
31 }; | 35 }; |
32 | 36 |
33 } // namespace blink | 37 } // namespace blink |
34 | 38 |
35 #endif // BluetoothUUID_h | 39 #endif // BluetoothUUID_h |
OLD | NEW |