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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h"
6
7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h"
9
10 namespace bluez {
11
12 BluetoothServiceAttributeValueBlueZ::BluetoothServiceAttributeValueBlueZ(
13 Type type,
14 size_t size,
15 std::unique_ptr<base::Value> value)
16 : type_(type), size_(size), value_(std::move(value)) {
17 CHECK_NE(type, SEQUENCE);
18 }
19
20 BluetoothServiceAttributeValueBlueZ::BluetoothServiceAttributeValueBlueZ(
21 std::unique_ptr<Sequence> sequence)
22 : type_(SEQUENCE),
23 size_(sequence->size()),
24 sequence_(std::move(sequence)) {}
25
26 BluetoothServiceAttributeValueBlueZ::BluetoothServiceAttributeValueBlueZ(
27 const BluetoothServiceAttributeValueBlueZ& attribute) {
28 this->type_ = attribute.type_;
29 this->size_ = attribute.size_;
30
31 if (attribute.type_ != SEQUENCE) {
32 this->value_ = base::WrapUnique(attribute.value_->DeepCopy());
33 return;
34 }
35
36 this->sequence_ = base::MakeUnique<Sequence>(*attribute.sequence_);
37 }
38
39 BluetoothServiceAttributeValueBlueZ BluetoothServiceAttributeValueBlueZ::
40 operator=(const BluetoothServiceAttributeValueBlueZ& attribute) {
41 return BluetoothServiceAttributeValueBlueZ(attribute);
42 }
43
44 BluetoothServiceAttributeValueBlueZ::~BluetoothServiceAttributeValueBlueZ() {}
45
46 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698