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

Unified Diff: components/arc/bluetooth/bluetooth_type_converters.cc

Issue 2511253002: arc: bluetooth: enable use_new_wrapper_types for bluetooth.mojom (Closed)
Patch Set: Rebase again Created 4 years, 1 month 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: components/arc/bluetooth/bluetooth_type_converters.cc
diff --git a/components/arc/bluetooth/bluetooth_type_converters.cc b/components/arc/bluetooth/bluetooth_type_converters.cc
index 6acc8c40457df34b909bb40b49754a4545e90c45..2d170d94e24fda1a3c9a306c83acb41adbfbab55 100644
--- a/components/arc/bluetooth/bluetooth_type_converters.cc
+++ b/components/arc/bluetooth/bluetooth_type_converters.cc
@@ -50,14 +50,10 @@ namespace mojo {
arc::mojom::BluetoothAddressPtr
TypeConverter<arc::mojom::BluetoothAddressPtr, std::string>::Convert(
const std::string& address) {
- std::string stripped = StripNonHex(address);
-
- std::vector<uint8_t> address_bytes;
- base::HexStringToBytes(stripped, &address_bytes);
arc::mojom::BluetoothAddressPtr mojo_addr =
arc::mojom::BluetoothAddress::New();
- mojo_addr->address = mojo::Array<uint8_t>::From(address_bytes);
+ base::HexStringToBytes(StripNonHex(address), &mojo_addr->address);
return mojo_addr;
}
@@ -68,7 +64,7 @@ std::string TypeConverter<std::string, arc::mojom::BluetoothAddress>::Convert(
std::ostringstream addr_stream;
addr_stream << std::setfill('0') << std::hex << std::uppercase;
- const mojo::Array<uint8_t>& bytes = address.address;
+ const std::vector<uint8_t>& bytes = address.address;
if (address.address.size() != kAddressSize)
return std::string(kInvalidAddress);
@@ -141,16 +137,12 @@ TypeConverter<arc::mojom::BluetoothSdpAttributePtr,
case bluez::BluetoothServiceAttributeValueBlueZ::BOOL:
result->type_size = attr_bluez.size();
result->value.Append(attr_bluez.value().CreateDeepCopy());
- result->sequence =
- mojo::Array<arc::mojom::BluetoothSdpAttributePtr>::New(0);
break;
case bluez::BluetoothServiceAttributeValueBlueZ::SEQUENCE:
if (depth + 1 >= arc::kBluetoothSDPMaxDepth) {
result->type = bluez::BluetoothServiceAttributeValueBlueZ::NULLTYPE;
result->type_size = 0;
result->value.Append(base::Value::CreateNullValue());
- result->sequence =
- mojo::Array<arc::mojom::BluetoothSdpAttributePtr>::New(0);
return result;
}
for (const auto& child : attr_bluez.sequence()) {

Powered by Google App Engine
This is Rietveld 408576698