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

Side by Side Diff: device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.cc

Issue 2284713002: device/bluetooth: Fix copy constructor of BluetoothServiceAttributeValueBlueZ (Closed)
Patch Set: device/bluetooth: Fix copy constructor of BluetoothServiceAttributeValueBlueZ Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h" 5 #include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 15 matching lines...) Expand all
26 std::unique_ptr<Sequence> sequence) 26 std::unique_ptr<Sequence> sequence)
27 : type_(SEQUENCE), 27 : type_(SEQUENCE),
28 size_(sequence->size()), 28 size_(sequence->size()),
29 sequence_(std::move(sequence)) {} 29 sequence_(std::move(sequence)) {}
30 30
31 BluetoothServiceAttributeValueBlueZ::BluetoothServiceAttributeValueBlueZ( 31 BluetoothServiceAttributeValueBlueZ::BluetoothServiceAttributeValueBlueZ(
32 const BluetoothServiceAttributeValueBlueZ& attribute) { 32 const BluetoothServiceAttributeValueBlueZ& attribute) {
33 this->type_ = attribute.type_; 33 this->type_ = attribute.type_;
34 this->size_ = attribute.size_; 34 this->size_ = attribute.size_;
35 35
36 if (attribute.type_ == NULLTYPE) {
37 this->value_ = base::Value::CreateNullValue();
38 return;
39 }
40
36 if (attribute.type_ != SEQUENCE) { 41 if (attribute.type_ != SEQUENCE) {
37 this->value_ = base::WrapUnique(attribute.value_->DeepCopy()); 42 this->value_ = base::WrapUnique(attribute.value_->DeepCopy());
38 return; 43 return;
39 } 44 }
40 45
41 this->sequence_ = base::MakeUnique<Sequence>(*attribute.sequence_); 46 this->sequence_ = base::MakeUnique<Sequence>(*attribute.sequence_);
42 } 47 }
43 48
44 BluetoothServiceAttributeValueBlueZ BluetoothServiceAttributeValueBlueZ:: 49 BluetoothServiceAttributeValueBlueZ BluetoothServiceAttributeValueBlueZ::
45 operator=(const BluetoothServiceAttributeValueBlueZ& attribute) { 50 operator=(const BluetoothServiceAttributeValueBlueZ& attribute) {
46 return BluetoothServiceAttributeValueBlueZ(attribute); 51 return BluetoothServiceAttributeValueBlueZ(attribute);
47 } 52 }
48 53
49 BluetoothServiceAttributeValueBlueZ::~BluetoothServiceAttributeValueBlueZ() {} 54 BluetoothServiceAttributeValueBlueZ::~BluetoothServiceAttributeValueBlueZ() {}
50 55
51 } // namespace bluez 56 } // namespace bluez
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698