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

Unified Diff: content/renderer/bluetooth/web_bluetooth_impl.cc

Issue 2394423002: bluetooth: Rename blink::mojom::WebBluetoothError (Closed)
Patch Set: bluetooth: Rename blink::mojom::WebBluetoothError Created 4 years, 2 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: content/renderer/bluetooth/web_bluetooth_impl.cc
diff --git a/content/renderer/bluetooth/web_bluetooth_impl.cc b/content/renderer/bluetooth/web_bluetooth_impl.cc
index 231cffce81debba9bc5009d30613ceeef3263957..b2f47992be244ff1f3e1cdcd58db7c342f8fe77f 100644
--- a/content/renderer/bluetooth/web_bluetooth_impl.cc
+++ b/content/renderer/bluetooth/web_bluetooth_impl.cc
@@ -28,10 +28,10 @@ namespace content {
namespace {
-// Blink can't use non-blink mojo enums like blink::mojom::WebBluetoothError, so
-// we pass it as an int32 across the boundary.
-int32_t ToInt32(blink::mojom::WebBluetoothError error) {
- return static_cast<int32_t>(error);
+// Blink can't use non-blink mojo enums like blink::mojom::WebBluetoothResult,
+// so we pass it as an int32 across the boundary.
+int32_t ToInt32(blink::mojom::WebBluetoothResult result) {
+ return static_cast<int32_t>(result);
}
} // namespace
@@ -182,9 +182,9 @@ void WebBluetoothImpl::RemoteCharacteristicValueChanged(
void WebBluetoothImpl::OnRequestDeviceComplete(
std::unique_ptr<blink::WebBluetoothRequestDeviceCallbacks> callbacks,
- const blink::mojom::WebBluetoothError error,
+ const blink::mojom::WebBluetoothResult result,
blink::mojom::WebBluetoothDevicePtr device) {
- if (error == blink::mojom::WebBluetoothError::SUCCESS) {
+ if (result == blink::mojom::WebBluetoothResult::SUCCESS) {
blink::WebVector<blink::WebString> uuids(device->uuids.size());
for (size_t i = 0; i < device->uuids.size(); ++i)
uuids[i] = blink::WebString::fromUTF8(device->uuids[i]);
@@ -195,7 +195,7 @@ void WebBluetoothImpl::OnRequestDeviceComplete(
: blink::WebString::fromUTF8(device->name),
uuids));
} else {
- callbacks->onError(ToInt32(error));
+ callbacks->onError(ToInt32(result));
}
}
@@ -215,20 +215,20 @@ void WebBluetoothImpl::GattServerDisconnected(
void WebBluetoothImpl::OnConnectComplete(
std::unique_ptr<blink::WebBluetoothRemoteGATTServerConnectCallbacks>
callbacks,
- blink::mojom::WebBluetoothError error) {
- if (error == blink::mojom::WebBluetoothError::SUCCESS) {
+ blink::mojom::WebBluetoothResult result) {
+ if (result == blink::mojom::WebBluetoothResult::SUCCESS) {
callbacks->onSuccess();
} else {
- callbacks->onError(ToInt32(error));
+ callbacks->onError(ToInt32(result));
}
}
void WebBluetoothImpl::OnGetPrimaryServicesComplete(
const blink::WebString& device_id,
std::unique_ptr<blink::WebBluetoothGetPrimaryServicesCallbacks> callbacks,
- blink::mojom::WebBluetoothError error,
+ blink::mojom::WebBluetoothResult result,
mojo::Array<blink::mojom::WebBluetoothRemoteGATTServicePtr> services) {
- if (error == blink::mojom::WebBluetoothError::SUCCESS) {
+ if (result == blink::mojom::WebBluetoothResult::SUCCESS) {
// TODO(dcheng): This WebVector should use smart pointers.
blink::WebVector<blink::WebBluetoothRemoteGATTService*> promise_services(
services.size());
@@ -241,17 +241,17 @@ void WebBluetoothImpl::OnGetPrimaryServicesComplete(
}
callbacks->onSuccess(promise_services);
} else {
- callbacks->onError(ToInt32(error));
+ callbacks->onError(ToInt32(result));
}
}
void WebBluetoothImpl::OnGetCharacteristicsComplete(
const blink::WebString& service_instance_id,
std::unique_ptr<blink::WebBluetoothGetCharacteristicsCallbacks> callbacks,
- blink::mojom::WebBluetoothError error,
+ blink::mojom::WebBluetoothResult result,
mojo::Array<blink::mojom::WebBluetoothRemoteGATTCharacteristicPtr>
characteristics) {
- if (error == blink::mojom::WebBluetoothError::SUCCESS) {
+ if (result == blink::mojom::WebBluetoothResult::SUCCESS) {
// TODO(dcheng): This WebVector should use smart pointers.
blink::WebVector<blink::WebBluetoothRemoteGATTCharacteristicInit*>
promise_characteristics(characteristics.size());
@@ -266,39 +266,39 @@ void WebBluetoothImpl::OnGetCharacteristicsComplete(
}
callbacks->onSuccess(promise_characteristics);
} else {
- callbacks->onError(ToInt32(error));
+ callbacks->onError(ToInt32(result));
}
}
void WebBluetoothImpl::OnReadValueComplete(
std::unique_ptr<blink::WebBluetoothReadValueCallbacks> callbacks,
- blink::mojom::WebBluetoothError error,
+ blink::mojom::WebBluetoothResult result,
mojo::Array<uint8_t> value) {
- if (error == blink::mojom::WebBluetoothError::SUCCESS) {
+ if (result == blink::mojom::WebBluetoothResult::SUCCESS) {
callbacks->onSuccess(value.PassStorage());
} else {
- callbacks->onError(ToInt32(error));
+ callbacks->onError(ToInt32(result));
}
}
void WebBluetoothImpl::OnWriteValueComplete(
const blink::WebVector<uint8_t>& value,
std::unique_ptr<blink::WebBluetoothWriteValueCallbacks> callbacks,
- blink::mojom::WebBluetoothError error) {
- if (error == blink::mojom::WebBluetoothError::SUCCESS) {
+ blink::mojom::WebBluetoothResult result) {
+ if (result == blink::mojom::WebBluetoothResult::SUCCESS) {
callbacks->onSuccess(value);
} else {
- callbacks->onError(ToInt32(error));
+ callbacks->onError(ToInt32(result));
}
}
void WebBluetoothImpl::OnStartNotificationsComplete(
std::unique_ptr<blink::WebBluetoothNotificationsCallbacks> callbacks,
- blink::mojom::WebBluetoothError error) {
- if (error == blink::mojom::WebBluetoothError::SUCCESS) {
+ blink::mojom::WebBluetoothResult result) {
+ if (result == blink::mojom::WebBluetoothResult::SUCCESS) {
callbacks->onSuccess();
} else {
- callbacks->onError(ToInt32(error));
+ callbacks->onError(ToInt32(result));
}
}
« no previous file with comments | « content/renderer/bluetooth/web_bluetooth_impl.h ('k') | third_party/WebKit/Source/modules/bluetooth/BluetoothError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698