|
|
DescriptionMove some functions from web_bluetooth_service_impl.cc to BluetoothDevice class
This CL moves GetCharacteristicsByUUID(), GetPrimaryServicesByUUID(), and
GetPrimaryServices() from web_bluetooth_service_impl.cc into BluetoothDevice
class.
BUG=552022
Review-Url: https://codereview.chromium.org/2615323002
Cr-Commit-Position: refs/heads/master@{#442396}
Committed: https://chromium.googlesource.com/chromium/src/+/ed9dda4b653e8176e3ff039776d269662280cd4c
Patch Set 1 : move some functions from web_bluetooth_service_impl.cc to BluetoothDevice class #
Total comments: 4
Patch Set 2 : address comments #Patch Set 3 : merge master #
Messages
Total messages: 32 (23 generated)
The CQ bit was checked by juncai@chromium.org to run a CQ dry run
Description was changed from ========== Moved some functions from web_bluetooth_service_impl.cc to BluetoothDevice class This CL moves GetCharacteristicsByUUID(), GetPrimaryServicesByUUID(), and GetPrimaryServices() from web_bluetooth_service_impl.cc into BluetoothDevice class. BUG=552022 ========== to ========== Move some functions from web_bluetooth_service_impl.cc to BluetoothDevice class This CL moves GetCharacteristicsByUUID(), GetPrimaryServicesByUUID(), and GetPrimaryServices() from web_bluetooth_service_impl.cc into BluetoothDevice class. BUG=552022 ==========
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
juncai@chromium.org changed reviewers: + scheib@chromium.org
Please take a look.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
LGTM with small changes https://codereview.chromium.org/2615323002/diff/1/device/bluetooth/bluetooth_... File device/bluetooth/bluetooth_device.cc (right): https://codereview.chromium.org/2615323002/diff/1/device/bluetooth/bluetooth_... device/bluetooth/bluetooth_device.cc:458: VLOG(1) << "Looking for characteristic: " Change these VLOGs to be VLOG(2). Now that we're in device/bluetooth they will be more spammy compared to when they were only in the web bluetooth code. https://codereview.chromium.org/2615323002/diff/1/device/bluetooth/bluetooth_... File device/bluetooth/bluetooth_device.h (right): https://codereview.chromium.org/2615323002/diff/1/device/bluetooth/bluetooth_... device/bluetooth/bluetooth_device.h:563: std::vector<BluetoothRemoteGattService*> GetPrimaryServicesByUUID( In Bluetooth concepts, the Services come before Characteristics, so I would prefer to order these methods with Services first, then Characteristics.
The CQ bit was checked by juncai@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2615323002/diff/1/device/bluetooth/bluetooth_... File device/bluetooth/bluetooth_device.cc (right): https://codereview.chromium.org/2615323002/diff/1/device/bluetooth/bluetooth_... device/bluetooth/bluetooth_device.cc:458: VLOG(1) << "Looking for characteristic: " On 2017/01/07 01:42:36, scheib wrote: > Change these VLOGs to be VLOG(2). Now that we're in device/bluetooth they will > be more spammy compared to when they were only in the web bluetooth code. Done. https://codereview.chromium.org/2615323002/diff/1/device/bluetooth/bluetooth_... File device/bluetooth/bluetooth_device.h (right): https://codereview.chromium.org/2615323002/diff/1/device/bluetooth/bluetooth_... device/bluetooth/bluetooth_device.h:563: std::vector<BluetoothRemoteGattService*> GetPrimaryServicesByUUID( On 2017/01/07 01:42:36, scheib wrote: > In Bluetooth concepts, the Services come before Characteristics, so I would > prefer to order these methods with Services first, then Characteristics. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by juncai@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org Link to the patchset: https://codereview.chromium.org/2615323002/#ps20001 (title: "address comments")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for content/browser/bluetooth/web_bluetooth_service_impl.cc: While running git apply --index -p1; error: patch failed: content/browser/bluetooth/web_bluetooth_service_impl.cc:130 error: content/browser/bluetooth/web_bluetooth_service_impl.cc: patch does not apply Patch: content/browser/bluetooth/web_bluetooth_service_impl.cc 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 0b70dec104fe52a3d47ae4b58a563db87f10a0f1..7448d6cd9b5fea6ea0758b42ef0655db9ca1aab9 100644 --- a/content/browser/bluetooth/web_bluetooth_service_impl.cc +++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc @@ -130,58 +130,6 @@ blink::mojom::WebBluetoothResult TranslateGATTErrorAndRecord( return blink::mojom::WebBluetoothResult::GATT_UNTRANSLATED_ERROR_CODE; } -// TODO(ortuno): This should really be a BluetoothDevice method. -// Replace when implemented. http://crbug.com/552022 -std::vector<device::BluetoothRemoteGattCharacteristic*> -GetCharacteristicsByUUID(device::BluetoothRemoteGattService* service, - const BluetoothUUID& characteristic_uuid) { - std::vector<device::BluetoothRemoteGattCharacteristic*> characteristics; - VLOG(1) << "Looking for characteristic: " - << characteristic_uuid.canonical_value(); - for (device::BluetoothRemoteGattCharacteristic* characteristic : - service->GetCharacteristics()) { - VLOG(1) << "Characteristic in cache: " - << characteristic->GetUUID().canonical_value(); - if (characteristic->GetUUID() == characteristic_uuid) { - characteristics.push_back(characteristic); - } - } - return characteristics; -} - -// TODO(ortuno): This should really be a BluetoothDevice method. -// Replace when implemented. http://crbug.com/552022 -std::vector<device::BluetoothRemoteGattService*> GetPrimaryServicesByUUID( - device::BluetoothDevice* device, - const BluetoothUUID& service_uuid) { - std::vector<device::BluetoothRemoteGattService*> services; - VLOG(1) << "Looking for service: " << service_uuid.canonical_value(); - for (device::BluetoothRemoteGattService* service : - device->GetGattServices()) { - VLOG(1) << "Service in cache: " << service->GetUUID().canonical_value(); - if (service->GetUUID() == service_uuid && service->IsPrimary()) { - services.push_back(service); - } - } - return services; -} - -// TODO(ortuno): This should really be a BluetoothDevice method. -// Replace when implemented. http://crbug.com/552022 -std::vector<device::BluetoothRemoteGattService*> GetPrimaryServices( - device::BluetoothDevice* device) { - std::vector<device::BluetoothRemoteGattService*> services; - VLOG(1) << "Looking for services."; - for (device::BluetoothRemoteGattService* service : - device->GetGattServices()) { - VLOG(1) << "Service in cache: " << service->GetUUID().canonical_value(); - if (service->IsPrimary()) { - services.push_back(service); - } - } - return services; -} - } // namespace WebBluetoothServiceImpl::WebBluetoothServiceImpl( @@ -491,8 +439,8 @@ void WebBluetoothServiceImpl::RemoteServiceGetCharacteristics( std::vector<device::BluetoothRemoteGattCharacteristic*> characteristics = characteristics_uuid - ? GetCharacteristicsByUUID(query_result.service, - characteristics_uuid.value()) + ? query_result.device->GetCharacteristicsByUUID( + service_instance_id, characteristics_uuid.value()) : query_result.service->GetCharacteristics(); std::vector<blink::mojom::WebBluetoothRemoteGATTCharacteristicPtr> @@ -723,8 +671,8 @@ void WebBluetoothServiceImpl::RemoteServerGetPrimaryServicesImpl( DCHECK(device->IsGattServicesDiscoveryComplete()); std::vector<device::BluetoothRemoteGattService*> services = - services_uuid ? GetPrimaryServicesByUUID(device, services_uuid.value()) - : GetPrimaryServices(device); + services_uuid ? device->GetPrimaryServicesByUUID(services_uuid.value()) + : device->GetPrimaryServices(); std::vector<blink::mojom::WebBluetoothRemoteGATTServicePtr> response_services; for (device::BluetoothRemoteGattService* service : services) {
The CQ bit was checked by juncai@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for content/browser/bluetooth/web_bluetooth_service_impl.cc: While running git apply --index -p1; error: patch failed: content/browser/bluetooth/web_bluetooth_service_impl.cc:130 error: content/browser/bluetooth/web_bluetooth_service_impl.cc: patch does not apply Patch: content/browser/bluetooth/web_bluetooth_service_impl.cc 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 0b70dec104fe52a3d47ae4b58a563db87f10a0f1..7448d6cd9b5fea6ea0758b42ef0655db9ca1aab9 100644 --- a/content/browser/bluetooth/web_bluetooth_service_impl.cc +++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc @@ -130,58 +130,6 @@ blink::mojom::WebBluetoothResult TranslateGATTErrorAndRecord( return blink::mojom::WebBluetoothResult::GATT_UNTRANSLATED_ERROR_CODE; } -// TODO(ortuno): This should really be a BluetoothDevice method. -// Replace when implemented. http://crbug.com/552022 -std::vector<device::BluetoothRemoteGattCharacteristic*> -GetCharacteristicsByUUID(device::BluetoothRemoteGattService* service, - const BluetoothUUID& characteristic_uuid) { - std::vector<device::BluetoothRemoteGattCharacteristic*> characteristics; - VLOG(1) << "Looking for characteristic: " - << characteristic_uuid.canonical_value(); - for (device::BluetoothRemoteGattCharacteristic* characteristic : - service->GetCharacteristics()) { - VLOG(1) << "Characteristic in cache: " - << characteristic->GetUUID().canonical_value(); - if (characteristic->GetUUID() == characteristic_uuid) { - characteristics.push_back(characteristic); - } - } - return characteristics; -} - -// TODO(ortuno): This should really be a BluetoothDevice method. -// Replace when implemented. http://crbug.com/552022 -std::vector<device::BluetoothRemoteGattService*> GetPrimaryServicesByUUID( - device::BluetoothDevice* device, - const BluetoothUUID& service_uuid) { - std::vector<device::BluetoothRemoteGattService*> services; - VLOG(1) << "Looking for service: " << service_uuid.canonical_value(); - for (device::BluetoothRemoteGattService* service : - device->GetGattServices()) { - VLOG(1) << "Service in cache: " << service->GetUUID().canonical_value(); - if (service->GetUUID() == service_uuid && service->IsPrimary()) { - services.push_back(service); - } - } - return services; -} - -// TODO(ortuno): This should really be a BluetoothDevice method. -// Replace when implemented. http://crbug.com/552022 -std::vector<device::BluetoothRemoteGattService*> GetPrimaryServices( - device::BluetoothDevice* device) { - std::vector<device::BluetoothRemoteGattService*> services; - VLOG(1) << "Looking for services."; - for (device::BluetoothRemoteGattService* service : - device->GetGattServices()) { - VLOG(1) << "Service in cache: " << service->GetUUID().canonical_value(); - if (service->IsPrimary()) { - services.push_back(service); - } - } - return services; -} - } // namespace WebBluetoothServiceImpl::WebBluetoothServiceImpl( @@ -491,8 +439,8 @@ void WebBluetoothServiceImpl::RemoteServiceGetCharacteristics( std::vector<device::BluetoothRemoteGattCharacteristic*> characteristics = characteristics_uuid - ? GetCharacteristicsByUUID(query_result.service, - characteristics_uuid.value()) + ? query_result.device->GetCharacteristicsByUUID( + service_instance_id, characteristics_uuid.value()) : query_result.service->GetCharacteristics(); std::vector<blink::mojom::WebBluetoothRemoteGATTCharacteristicPtr> @@ -723,8 +671,8 @@ void WebBluetoothServiceImpl::RemoteServerGetPrimaryServicesImpl( DCHECK(device->IsGattServicesDiscoveryComplete()); std::vector<device::BluetoothRemoteGattService*> services = - services_uuid ? GetPrimaryServicesByUUID(device, services_uuid.value()) - : GetPrimaryServices(device); + services_uuid ? device->GetPrimaryServicesByUUID(services_uuid.value()) + : device->GetPrimaryServices(); std::vector<blink::mojom::WebBluetoothRemoteGATTServicePtr> response_services; for (device::BluetoothRemoteGattService* service : services) {
The CQ bit was checked by juncai@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by juncai@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org Link to the patchset: https://codereview.chromium.org/2615323002/#ps40001 (title: "merge master")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 40001, "attempt_start_ts": 1484001514270390, "parent_rev": "4acd5701bc00537137c218a5fc75daa6cb0e3099", "commit_rev": "ed9dda4b653e8176e3ff039776d269662280cd4c"}
Message was sent while issue was closed.
Description was changed from ========== Move some functions from web_bluetooth_service_impl.cc to BluetoothDevice class This CL moves GetCharacteristicsByUUID(), GetPrimaryServicesByUUID(), and GetPrimaryServices() from web_bluetooth_service_impl.cc into BluetoothDevice class. BUG=552022 ========== to ========== Move some functions from web_bluetooth_service_impl.cc to BluetoothDevice class This CL moves GetCharacteristicsByUUID(), GetPrimaryServicesByUUID(), and GetPrimaryServices() from web_bluetooth_service_impl.cc into BluetoothDevice class. BUG=552022 Review-Url: https://codereview.chromium.org/2615323002 Cr-Commit-Position: refs/heads/master@{#442396} Committed: https://chromium.googlesource.com/chromium/src/+/ed9dda4b653e8176e3ff039776d2... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/ed9dda4b653e8176e3ff039776d2... |