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

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

Issue 1914893002: DBus changes for implementing local GATT attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth_classes
Patch Set: test leak fix 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
(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/dbus/fake_bluetooth_gatt_application_service_provider .h"
6
7 #include <string>
8
9 #include "base/logging.h"
10 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
11 #include "device/bluetooth/dbus/fake_bluetooth_gatt_manager_client.h"
12
13 namespace bluez {
14
15 FakeBluetoothGattApplicationServiceProvider::
16 FakeBluetoothGattApplicationServiceProvider(
17 const dbus::ObjectPath& object_path,
18 const std::map<dbus::ObjectPath, BluetoothLocalGattServiceBlueZ*>&
19 services)
20 : object_path_(object_path) {
21 VLOG(1) << "Creating Bluetooth GATT service: " << object_path_.value();
22
23 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
24 static_cast<FakeBluetoothGattManagerClient*>(
25 bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
26 fake_bluetooth_gatt_manager_client->RegisterApplicationServiceProvider(this);
27
28 BluetoothGattApplicationServiceProvider::CreateAttributeServiceProviders(
29 nullptr, services, &service_providers_, &characteristic_providers_,
30 &descriptor_providers_);
31 }
32
33 FakeBluetoothGattApplicationServiceProvider::
34 ~FakeBluetoothGattApplicationServiceProvider() {
35 VLOG(1) << "Cleaning up Bluetooth GATT application: " << object_path_.value();
36
37 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
38 static_cast<FakeBluetoothGattManagerClient*>(
39 bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
40 fake_bluetooth_gatt_manager_client->UnregisterApplicationServiceProvider(
41 this);
42 }
43
44 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698