Chromium Code Reviews

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTUtils.h

Issue 2680783002: bluetooth: show better error messages for services, characteristics and descriptors (Closed)
Patch Set: Use CreateDOMException instead of take(). Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 BluetoothRemoteGATTUtils_h 5 #ifndef BluetoothRemoteGATTUtils_h
6 #define BluetoothRemoteGATTUtils_h 6 #define BluetoothRemoteGATTUtils_h
7 7
8 #include "core/dom/DOMDataView.h" 8 #include "core/dom/DOMDataView.h"
9 #include "core/dom/DOMException.h"
10 #include "wtf/Vector.h" 9 #include "wtf/Vector.h"
11 10
12 namespace blink { 11 namespace blink {
13 12
14 class BluetoothRemoteGATTUtils final { 13 class BluetoothRemoteGATTUtils final {
15 public: 14 public:
16 static DOMDataView* ConvertWTFVectorToDataView(const WTF::Vector<uint8_t>&); 15 static DOMDataView* ConvertWTFVectorToDataView(const WTF::Vector<uint8_t>&);
17 16
18 enum ExceptionType { 17 enum ExceptionType {
19 kGATTServerDisconnected, 18 kGATTServerDisconnected,
20 kGATTServerNotConnected, 19 kGATTServerNotConnected,
21 kInvalidCharacteristic, 20 kInvalidCharacteristic,
22 kInvalidDescriptor 21 kInvalidDescriptor
dcheng 2017/02/09 19:16:42 Are these still needed?
perja 2017/02/10 13:28:16 Done.
23 }; 22 };
24
25 static DOMException* CreateDOMException(ExceptionType);
26 }; 23 };
27 24
28 } // namespace blink 25 } // namespace blink
29 26
30 #endif // BluetoothRemoteGATTUtils_h 27 #endif // BluetoothRemoteGATTUtils_h
OLDNEW

Powered by Google App Engine