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

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

Issue 2392713002: mojo: Mark DataView readers as WARN_UNUSED_RESULT. (Closed)
Patch Set: Fix attribute placement to appease gcc 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
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/cpp_templates/module-shared.h.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/bluetooth/bluetooth_struct_traits.cc
diff --git a/components/arc/bluetooth/bluetooth_struct_traits.cc b/components/arc/bluetooth/bluetooth_struct_traits.cc
index e5983cc5b7a97638bae14169083d2e482fc9e658..85c5ae2ba6872c5c247c2694ef97c071632446af 100644
--- a/components/arc/bluetooth/bluetooth_struct_traits.cc
+++ b/components/arc/bluetooth/bluetooth_struct_traits.cc
@@ -34,6 +34,8 @@ namespace mojo {
std::vector<uint8_t>
StructTraits<arc::mojom::BluetoothUUIDDataView, device::BluetoothUUID>::uuid(
const device::BluetoothUUID& input) {
+ // TODO(dcheng): Figure out what to do here, this is called twice on
+ // serialization. Building a vector is a little inefficient.
std::string uuid_str = StripNonHex(input.canonical_value());
std::vector<uint8_t> address_bytes;
@@ -47,7 +49,8 @@ bool StructTraits<arc::mojom::BluetoothUUIDDataView,
arc::mojom::BluetoothUUIDDataView data,
device::BluetoothUUID* output) {
std::vector<uint8_t> address_bytes;
- data.ReadUuid(&address_bytes);
+ if (!data.ReadUuid(&address_bytes))
+ return false;
if (address_bytes.size() != kUUIDSize)
return false;
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/cpp_templates/module-shared.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698