Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp

Issue 2721233002: bluetooth: Better disconnected error messages for characteristic retrieval. (Closed)
Patch Set: Address dcheng's comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp
index 26228951bf1f71469ef006ceb808f1a2a4f73a4f..31837a085e492751fd152b11cdc2001c19e035c0 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp
@@ -48,9 +48,8 @@ void BluetoothRemoteGATTService::GetCharacteristicsCallback(
// If the device is disconnected, reject.
if (!m_device->gatt()->RemoveFromActiveAlgorithms(resolver)) {
- resolver->reject(BluetoothError::createDOMException(
- mojom::blink::WebBluetoothResult::
- GATT_SERVER_DISCONNECTED_WHILE_RETRIEVING_CHARACTERISTICS));
+ resolver->reject(BluetoothError::createNotConnectedException(
+ BluetoothOperation::CharacteristicsRetrieval));
return;
}
@@ -127,10 +126,8 @@ ScriptPromise BluetoothRemoteGATTService::getCharacteristicsImpl(
const String& characteristicsUUID) {
if (!m_device->gatt()->connected()) {
return ScriptPromise::rejectWithDOMException(
- scriptState,
- BluetoothError::createDOMException(
- mojom::blink::WebBluetoothResult::
- GATT_SERVER_NOT_CONNECTED_CANNOT_RETRIEVE_CHARACTERISTICS));
+ scriptState, BluetoothError::createNotConnectedException(
+ BluetoothOperation::CharacteristicsRetrieval));
}
if (!m_device->isValidService(m_service->instance_id)) {

Powered by Google App Engine
This is Rietveld 408576698