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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_api_utils.cc

Issue 2228953003: bluetooth: Change GetInquiryTxPower and GetInquiryRSSI to return optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: TIL value_or Created 4 years, 4 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
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_device.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/bluetooth/bluetooth_api_utils.cc
diff --git a/extensions/browser/api/bluetooth/bluetooth_api_utils.cc b/extensions/browser/api/bluetooth/bluetooth_api_utils.cc
index 5176c684203092ba11100a1de010fd4a65b8b97a..f6b3b2caee158ba96544c01e141375a7bb8e2b78 100644
--- a/extensions/browser/api/bluetooth/bluetooth_api_utils.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_api_utils.cc
@@ -122,13 +122,13 @@ void BluetoothDeviceToApiDevice(const device::BluetoothDevice& device,
string_uuids->push_back(iter->canonical_value());
out->uuids.reset(string_uuids);
- if (device.GetInquiryRSSI() != device::BluetoothDevice::kUnknownPower)
- out->inquiry_rssi.reset(new int(device.GetInquiryRSSI()));
+ if (device.GetInquiryRSSI())
+ out->inquiry_rssi.reset(new int(device.GetInquiryRSSI().value()));
else
out->inquiry_rssi.reset();
- if (device.GetInquiryTxPower() != device::BluetoothDevice::kUnknownPower)
- out->inquiry_tx_power.reset(new int(device.GetInquiryTxPower()));
+ if (device.GetInquiryTxPower())
+ out->inquiry_tx_power.reset(new int(device.GetInquiryTxPower().value()));
else
out->inquiry_tx_power.reset();
}
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698