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

Unified Diff: content/browser/bluetooth/web_bluetooth_service_impl.cc

Issue 1898643002: Refactor device::BluetoothGattXXX classes to split into remote/local. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/browser/bluetooth/web_bluetooth_service_impl.cc
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.cc b/content/browser/bluetooth/web_bluetooth_service_impl.cc
index 7f6228c080efc28a4702ce315697cb94102eaf8c..6b390d8def678033ae37d820f0a0784139df3bd8 100644
--- a/content/browser/bluetooth/web_bluetooth_service_impl.cc
+++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -11,45 +11,45 @@
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
-#include "device/bluetooth/bluetooth_gatt_characteristic.h"
+#include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
-using device::BluetoothGattService;
+using device::BluetoothRemoteGattService;
namespace content {
namespace {
blink::mojom::WebBluetoothError TranslateGATTErrorAndRecord(
- BluetoothGattService::GattErrorCode error_code,
+ BluetoothRemoteGattService::GattErrorCode error_code,
UMAGATTOperation operation) {
switch (error_code) {
- case BluetoothGattService::GATT_ERROR_UNKNOWN:
+ case BluetoothRemoteGattService::GATT_ERROR_UNKNOWN:
RecordGATTOperationOutcome(operation, UMAGATTOperationOutcome::UNKNOWN);
return blink::mojom::WebBluetoothError::GATT_UNKNOWN_ERROR;
- case BluetoothGattService::GATT_ERROR_FAILED:
+ case BluetoothRemoteGattService::GATT_ERROR_FAILED:
RecordGATTOperationOutcome(operation, UMAGATTOperationOutcome::FAILED);
return blink::mojom::WebBluetoothError::GATT_UNKNOWN_FAILURE;
- case BluetoothGattService::GATT_ERROR_IN_PROGRESS:
+ case BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS:
RecordGATTOperationOutcome(operation,
UMAGATTOperationOutcome::IN_PROGRESS);
return blink::mojom::WebBluetoothError::GATT_OPERATION_IN_PROGRESS;
- case BluetoothGattService::GATT_ERROR_INVALID_LENGTH:
+ case BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH:
RecordGATTOperationOutcome(operation,
UMAGATTOperationOutcome::INVALID_LENGTH);
return blink::mojom::WebBluetoothError::GATT_INVALID_ATTRIBUTE_LENGTH;
- case BluetoothGattService::GATT_ERROR_NOT_PERMITTED:
+ case BluetoothRemoteGattService::GATT_ERROR_NOT_PERMITTED:
RecordGATTOperationOutcome(operation,
UMAGATTOperationOutcome::NOT_PERMITTED);
return blink::mojom::WebBluetoothError::GATT_NOT_PERMITTED;
- case BluetoothGattService::GATT_ERROR_NOT_AUTHORIZED:
+ case BluetoothRemoteGattService::GATT_ERROR_NOT_AUTHORIZED:
RecordGATTOperationOutcome(operation,
UMAGATTOperationOutcome::NOT_AUTHORIZED);
return blink::mojom::WebBluetoothError::GATT_NOT_AUTHORIZED;
- case BluetoothGattService::GATT_ERROR_NOT_PAIRED:
+ case BluetoothRemoteGattService::GATT_ERROR_NOT_PAIRED:
RecordGATTOperationOutcome(operation,
UMAGATTOperationOutcome::NOT_PAIRED);
return blink::mojom::WebBluetoothError::GATT_NOT_PAIRED;
- case BluetoothGattService::GATT_ERROR_NOT_SUPPORTED:
+ case BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED:
RecordGATTOperationOutcome(operation,
UMAGATTOperationOutcome::NOT_SUPPORTED);
return blink::mojom::WebBluetoothError::GATT_NOT_SUPPORTED;
@@ -105,7 +105,7 @@ void WebBluetoothServiceImpl::AdapterPresentChanged(
void WebBluetoothServiceImpl::GattCharacteristicValueChanged(
device::BluetoothAdapter* adapter,
- device::BluetoothGattCharacteristic* characteristic,
+ device::BluetoothRemoteGattCharacteristic* characteristic,
const std::vector<uint8_t>& value) {
// TODO(ortuno): Only send characteristic value changed events for
// characteristics that we've returned in the past. We can't yet do
@@ -257,10 +257,10 @@ void WebBluetoothServiceImpl::RemoteCharacteristicStartNotifications(
return;
}
- device::BluetoothGattCharacteristic::Properties notify_or_indicate =
+ device::BluetoothRemoteGattCharacteristic::Properties notify_or_indicate =
query_result.characteristic->GetProperties() &
- (device::BluetoothGattCharacteristic::PROPERTY_NOTIFY |
- device::BluetoothGattCharacteristic::PROPERTY_INDICATE);
+ (device::BluetoothRemoteGattCharacteristic::PROPERTY_NOTIFY |
+ device::BluetoothRemoteGattCharacteristic::PROPERTY_INDICATE);
if (!notify_or_indicate) {
callback.Run(blink::mojom::WebBluetoothError::GATT_NOT_SUPPORTED);
return;
@@ -313,7 +313,7 @@ void WebBluetoothServiceImpl::OnReadValueSuccess(
void WebBluetoothServiceImpl::OnReadValueFailed(
const RemoteCharacteristicReadValueCallback& callback,
- device::BluetoothGattService::GattErrorCode error_code) {
+ device::BluetoothRemoteGattService::GattErrorCode error_code) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
callback.Run(TranslateGATTErrorAndRecord(
error_code, UMAGATTOperation::CHARACTERISTIC_READ),
@@ -329,7 +329,7 @@ void WebBluetoothServiceImpl::OnWriteValueSuccess(
void WebBluetoothServiceImpl::OnWriteValueFailed(
const RemoteCharacteristicWriteValueCallback& callback,
- device::BluetoothGattService::GattErrorCode error_code) {
+ device::BluetoothRemoteGattService::GattErrorCode error_code) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
callback.Run(TranslateGATTErrorAndRecord(
error_code, UMAGATTOperation::CHARACTERISTIC_WRITE));
@@ -351,7 +351,7 @@ void WebBluetoothServiceImpl::OnStartNotifySessionSuccess(
void WebBluetoothServiceImpl::OnStartNotifySessionFailed(
const RemoteCharacteristicStartNotificationsCallback& callback,
- device::BluetoothGattService::GattErrorCode error_code) {
+ device::BluetoothRemoteGattService::GattErrorCode error_code) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
callback.Run(TranslateGATTErrorAndRecord(
error_code, UMAGATTOperation::START_NOTIFICATIONS));

Powered by Google App Engine
This is Rietveld 408576698