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

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

Issue 1954643002: DBus support for attribute properties and permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@register_and_events
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
« no previous file with comments | « no previous file | device/bluetooth/dbus/bluetooth_gatt_application_service_provider_impl.cc » ('j') | 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/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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 bus, service.second->object_path(), 44 bus, service.second->object_path(),
45 service.second->GetUUID().value(), service.second->IsPrimary(), 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.second->object_path(), 50 bus, characteristic.second->object_path(),
51 base::WrapUnique(new BluetoothGattCharacteristicDelegateWrapper( 51 base::WrapUnique(new BluetoothGattCharacteristicDelegateWrapper(
52 service.second, characteristic.second.get())), 52 service.second, characteristic.second.get())),
53 characteristic.second->GetUUID().value(), 53 characteristic.second->GetUUID().value(),
54 std::vector<std::string>(), std::vector<std::string>(), 54 std::vector<std::string>(), service.second->object_path())));
55 service.second->object_path())));
56 for (const auto& descriptor : characteristic.second->GetDescriptors()) { 55 for (const auto& descriptor : characteristic.second->GetDescriptors()) {
57 descriptor_providers->push_back( 56 descriptor_providers->push_back(
58 base::WrapUnique(BluetoothGattDescriptorServiceProvider::Create( 57 base::WrapUnique(BluetoothGattDescriptorServiceProvider::Create(
59 bus, descriptor->object_path(), 58 bus, descriptor->object_path(),
60 base::WrapUnique(new BluetoothGattDescriptorDelegateWrapper( 59 base::WrapUnique(new BluetoothGattDescriptorDelegateWrapper(
61 service.second, descriptor.get())), 60 service.second, descriptor.get())),
62 descriptor->GetUUID().value(), std::vector<std::string>(), 61 descriptor->GetUUID().value(), std::vector<std::string>(),
63 characteristic.second->object_path()))); 62 characteristic.second->object_path())));
64 } 63 }
65 } 64 }
66 } 65 }
67 } 66 }
68 67
69 // static 68 // static
70 std::unique_ptr<BluetoothGattApplicationServiceProvider> 69 std::unique_ptr<BluetoothGattApplicationServiceProvider>
71 BluetoothGattApplicationServiceProvider::Create( 70 BluetoothGattApplicationServiceProvider::Create(
72 dbus::Bus* bus, 71 dbus::Bus* bus,
73 const dbus::ObjectPath& object_path, 72 const dbus::ObjectPath& object_path,
74 const std::map<dbus::ObjectPath, BluetoothLocalGattServiceBlueZ*>& 73 const std::map<dbus::ObjectPath, BluetoothLocalGattServiceBlueZ*>&
75 services) { 74 services) {
76 if (!bluez::BluezDBusManager::Get()->IsUsingFakes()) { 75 if (!bluez::BluezDBusManager::Get()->IsUsingFakes()) {
77 return base::WrapUnique(new BluetoothGattApplicationServiceProviderImpl( 76 return base::WrapUnique(new BluetoothGattApplicationServiceProviderImpl(
78 bus, object_path, services)); 77 bus, object_path, services));
79 } 78 }
80 return base::WrapUnique( 79 return base::WrapUnique(
81 new FakeBluetoothGattApplicationServiceProvider(object_path, services)); 80 new FakeBluetoothGattApplicationServiceProvider(object_path, services));
82 } 81 }
83 82
84 } // namespace bluez 83 } // namespace bluez
OLDNEW
« no previous file with comments | « no previous file | device/bluetooth/dbus/bluetooth_gatt_application_service_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698