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

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

Issue 2729433002: bluetooth: Better disconnected error messages for GATT operations. (Closed)
Patch Set: rebase 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/BluetoothRemoteGATTDescriptor.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.cpp
index ad14abb1b48ae1052934bcdfe83e658579e99df4..d6a72b3b5954880f1e0d65ae8f68fd751bcbb020 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.cpp
@@ -38,8 +38,8 @@ void BluetoothRemoteGATTDescriptor::ReadValueCallback(
// If the device is disconnected, reject.
if (!getGatt()->RemoveFromActiveAlgorithms(resolver)) {
- resolver->reject(BluetoothError::createDOMException(
- mojom::blink::WebBluetoothResult::GATT_SERVER_DISCONNECTED));
+ resolver->reject(
+ BluetoothError::createNotConnectedException(BluetoothOperation::GATT));
return;
}
@@ -59,8 +59,7 @@ ScriptPromise BluetoothRemoteGATTDescriptor::readValue(
if (!getGatt()->connected()) {
return ScriptPromise::rejectWithDOMException(
scriptState,
- BluetoothError::createDOMException(
- mojom::blink::WebBluetoothResult::GATT_SERVER_NOT_CONNECTED));
+ BluetoothError::createNotConnectedException(BluetoothOperation::GATT));
}
if (!getGatt()->device()->isValidDescriptor(m_descriptor->instance_id)) {
@@ -91,8 +90,8 @@ void BluetoothRemoteGATTDescriptor::WriteValueCallback(
// If the resolver is not in the set of ActiveAlgorithms then the frame
// disconnected so we reject.
if (!getGatt()->RemoveFromActiveAlgorithms(resolver)) {
- resolver->reject(BluetoothError::createDOMException(
- mojom::blink::WebBluetoothResult::GATT_SERVER_DISCONNECTED));
+ resolver->reject(
+ BluetoothError::createNotConnectedException(BluetoothOperation::GATT));
return;
}
@@ -110,8 +109,7 @@ ScriptPromise BluetoothRemoteGATTDescriptor::writeValue(
if (!getGatt()->connected()) {
return ScriptPromise::rejectWithDOMException(
scriptState,
- BluetoothError::createDOMException(
- mojom::blink::WebBluetoothResult::GATT_SERVER_NOT_CONNECTED));
+ BluetoothError::createNotConnectedException(BluetoothOperation::GATT));
}
if (!getGatt()->device()->isValidDescriptor(m_descriptor->instance_id)) {

Powered by Google App Engine
This is Rietveld 408576698