Chromium Code Reviews| 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 module blink.mojom; | 5 module blink.mojom; |
| 5 | 6 |
| 6 // Errors that can occur during Web Bluetooth execution, which are transformed | 7 // Errors that can occur during Web Bluetooth execution, which are transformed |
| 7 // to a DOMException in Source/modules/bluetooth/BluetoothError.cpp. | 8 // to a DOMException in Source/modules/bluetooth/BluetoothError.cpp. |
| 8 // | 9 // |
| 9 // These errors all produce constant message strings. If a particular message | 10 // These errors all produce constant message strings. If a particular message |
| 10 // needs a dynamic component, we should add a separate enum so type-checking the | 11 // needs a dynamic component, we should add a separate enum so type-checking the |
| 11 // IPC ensures the dynamic component is passed. | 12 // IPC ensures the dynamic component is passed. |
| 12 enum WebBluetoothError { | 13 enum WebBluetoothError { |
|
scheib
2016/03/31 04:17:51
Not always an Error, so Result?
ortuno
2016/03/31 16:56:44
Opened http://crbug.com/599489
| |
| 13 SUCCESS, | 14 SUCCESS, |
| 14 // AbortError: | 15 // AbortError: |
| 15 // InvalidModificationError: | 16 // InvalidModificationError: |
| 16 GATT_INVALID_ATTRIBUTE_LENGTH, | 17 GATT_INVALID_ATTRIBUTE_LENGTH, |
| 17 // InvalidStateError: | 18 // InvalidStateError: |
| 18 SERVICE_NO_LONGER_EXISTS, | 19 SERVICE_NO_LONGER_EXISTS, |
| 19 CHARACTERISTIC_NO_LONGER_EXISTS, | 20 CHARACTERISTIC_NO_LONGER_EXISTS, |
| 20 // NetworkError: | 21 // NetworkError: |
| 21 CONNECT_ALREADY_IN_PROGRESS, | 22 CONNECT_ALREADY_IN_PROGRESS, |
| 22 CONNECT_ATTRIBUTE_LENGTH_INVALID, | 23 CONNECT_ATTRIBUTE_LENGTH_INVALID, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 REQUEST_DEVICE_WITH_BLACKLISTED_UUID, | 62 REQUEST_DEVICE_WITH_BLACKLISTED_UUID, |
| 62 REQUEST_DEVICE_WITH_UNIQUE_ORIGIN, | 63 REQUEST_DEVICE_WITH_UNIQUE_ORIGIN, |
| 63 REQUEST_DEVICE_WITHOUT_FRAME, | 64 REQUEST_DEVICE_WITHOUT_FRAME, |
| 64 // SyntaxError: | 65 // SyntaxError: |
| 65 // TODO(ortuno): Remove once we no longer use IPC. | 66 // TODO(ortuno): Remove once we no longer use IPC. |
| 66 ENUM_MAX_VALUE = REQUEST_DEVICE_WITHOUT_FRAME, | 67 ENUM_MAX_VALUE = REQUEST_DEVICE_WITHOUT_FRAME, |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 // TODO(ortuno): Define Bluetooth Service. | 70 // TODO(ortuno): Define Bluetooth Service. |
| 70 // https://crbug.com/508771 | 71 // https://crbug.com/508771 |
| 72 | |
| 73 // Web Bluetooth Interface that Blink can use to perform | |
| 74 // Bluetooth GATT Operations on Bluetooth Devices. | |
| 75 interface WebBluetoothService { | |
|
scheib
2016/03/31 04:17:51
In person we discussed and I thought you said the
ortuno
2016/03/31 16:56:44
Yes. That's the long term plan. Since that + mojo
| |
| 76 | |
| 77 // Writes a value to the characteristic with | |
| 78 // |characteristic_instance_id|. The callback is run with | |
| 79 // WebBluetoothError::SUCCESS if the value was successfully | |
| 80 // written. | |
| 81 RemoteCharacteristicWriteValue( | |
| 82 string characteristic_instance_id, | |
| 83 array<uint8> value) => (WebBluetoothError error); | |
|
scheib
2016/03/31 04:17:51
error -> result
ortuno
2016/03/31 16:56:44
Will do in http://crbug.com/599489
| |
| 84 | |
| 85 }; | |
| OLD | NEW |