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

Unified Diff: device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.cc

Issue 2084463002: BlueZ + DBus implementations of create/remove service record functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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: device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.cc
diff --git a/device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.cc b/device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a39f36ebc7bb8fa4fd85b7d32e61fbe20380a20f
--- /dev/null
+++ b/device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.cc
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h"
+
+#include "base/logging.h"
+#include "base/memory/ptr_util.h"
+
+namespace bluez {
+
+BluetoothServiceAttributeValueBlueZ::BluetoothServiceAttributeValueBlueZ(
+ Type type,
+ size_t size,
+ std::unique_ptr<base::Value> value)
+ : type_(type), size_(size), value_(std::move(value)) {
+ CHECK_NE(type, SEQUENCE);
+}
+
+BluetoothServiceAttributeValueBlueZ::BluetoothServiceAttributeValueBlueZ(
+ std::unique_ptr<Sequence> sequence)
+ : type_(SEQUENCE),
+ size_(sequence->size()),
+ sequence_(std::move(sequence)) {}
+
+BluetoothServiceAttributeValueBlueZ::BluetoothServiceAttributeValueBlueZ(
+ const BluetoothServiceAttributeValueBlueZ& attribute) {
+ this->type_ = attribute.type_;
+ this->size_ = attribute.size_;
+
+ if (attribute.type_ != SEQUENCE) {
+ this->value_ = base::WrapUnique(attribute.value_->DeepCopy());
+ return;
+ }
+
+ this->sequence_ = base::MakeUnique<Sequence>(*attribute.sequence_);
+}
+
+BluetoothServiceAttributeValueBlueZ BluetoothServiceAttributeValueBlueZ::
+operator=(const BluetoothServiceAttributeValueBlueZ& attribute) {
+ return BluetoothServiceAttributeValueBlueZ(attribute);
+}
+
+BluetoothServiceAttributeValueBlueZ::~BluetoothServiceAttributeValueBlueZ() {}
+
+} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698