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

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/utils.cc

Issue 1915243003: API Bindings for GATT server functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@adapter_and_tests
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: chrome/browser/extensions/api/bluetooth_low_energy/utils.cc
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc b/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc
index c3b65d19d7afd52ae167bb3ba3ae29da03f2dd8c..a3143f2cd3c4774fcb9fb149934143d29565c2d6 100644
--- a/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc
@@ -4,6 +4,12 @@
#include "chrome/browser/extensions/api/bluetooth_low_energy/utils.h"
+#include <stddef.h>
+#include <iterator>
+#include <vector>
+
+#include "base/logging.h"
+
namespace extensions {
namespace api {
namespace bluetooth_low_energy {
@@ -38,10 +44,13 @@ std::unique_ptr<base::DictionaryValue> CharacteristicToValue(
}
std::unique_ptr<base::DictionaryValue> DescriptorToValue(Descriptor* from) {
+ if (!from->characteristic)
+ return from->ToValue();
+
// Copy the characteristic properties and set them later manually.
std::vector<CharacteristicProperty> properties =
- from->characteristic.properties;
- from->characteristic.properties.clear();
+ from->characteristic->properties;
+ from->characteristic->properties.clear();
std::unique_ptr<base::DictionaryValue> to = from->ToValue();
base::DictionaryValue* chrc_value = NULL;

Powered by Google App Engine
This is Rietveld 408576698