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

Side by Side Diff: device/bluetooth/dbus/bluetooth_gatt_application_service_provider.cc

Issue 1946053002: Fixes to DBus GATT components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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/dbus/bluetooth_gatt_application_service_provider.h" 5 #include "device/bluetooth/dbus/bluetooth_gatt_application_service_provider.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 24 matching lines...) Expand all
35 std::vector<std::unique_ptr<BluetoothGattServiceServiceProvider>>* 35 std::vector<std::unique_ptr<BluetoothGattServiceServiceProvider>>*
36 service_providers, 36 service_providers,
37 std::vector<std::unique_ptr<BluetoothGattCharacteristicServiceProvider>>* 37 std::vector<std::unique_ptr<BluetoothGattCharacteristicServiceProvider>>*
38 characteristic_providers, 38 characteristic_providers,
39 std::vector<std::unique_ptr<BluetoothGattDescriptorServiceProvider>>* 39 std::vector<std::unique_ptr<BluetoothGattDescriptorServiceProvider>>*
40 descriptor_providers) { 40 descriptor_providers) {
41 for (const auto& service : services) { 41 for (const auto& service : services) {
42 service_providers->push_back( 42 service_providers->push_back(
43 base::WrapUnique(BluetoothGattServiceServiceProvider::Create( 43 base::WrapUnique(BluetoothGattServiceServiceProvider::Create(
44 bus, service.second->object_path(), 44 bus, service.second->object_path(),
45 service.second->GetUUID().value(), 45 service.second->GetUUID().value(), service.second->IsPrimary(),
46 std::vector<dbus::ObjectPath>()))); 46 std::vector<dbus::ObjectPath>())));
47 for (const auto& characteristic : service.second->GetCharacteristics()) { 47 for (const auto& characteristic : service.second->GetCharacteristics()) {
48 characteristic_providers->push_back( 48 characteristic_providers->push_back(
49 base::WrapUnique(BluetoothGattCharacteristicServiceProvider::Create( 49 base::WrapUnique(BluetoothGattCharacteristicServiceProvider::Create(
50 bus, characteristic->object_path(), 50 bus, characteristic->object_path(),
51 base::WrapUnique(new BluetoothGattCharacteristicDelegateWrapper( 51 base::WrapUnique(new BluetoothGattCharacteristicDelegateWrapper(
52 service.second, characteristic.get())), 52 service.second, characteristic.get())),
53 characteristic->GetUUID().value(), std::vector<std::string>(), 53 characteristic->GetUUID().value(), std::vector<std::string>(),
54 std::vector<std::string>(), service.second->object_path()))); 54 std::vector<std::string>(), service.second->object_path())));
55 for (const auto& descriptor : characteristic->GetDescriptors()) { 55 for (const auto& descriptor : characteristic->GetDescriptors()) {
(...skipping 18 matching lines...) Expand all
74 services) { 74 services) {
75 if (!bluez::BluezDBusManager::Get()->IsUsingFakes()) { 75 if (!bluez::BluezDBusManager::Get()->IsUsingFakes()) {
76 return base::WrapUnique(new BluetoothGattApplicationServiceProviderImpl( 76 return base::WrapUnique(new BluetoothGattApplicationServiceProviderImpl(
77 bus, object_path, services)); 77 bus, object_path, services));
78 } 78 }
79 return base::WrapUnique( 79 return base::WrapUnique(
80 new FakeBluetoothGattApplicationServiceProvider(object_path, services)); 80 new FakeBluetoothGattApplicationServiceProvider(object_path, services));
81 } 81 }
82 82
83 } // namespace bluez 83 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698