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

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

Issue 1347193004: Refactor DBusThreadManager to split away BT clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromeos/dbus/fake_bluetooth_gatt_service_service_provider.h" 5 #include "device/bluetooth/dbus/fake_bluetooth_gatt_service_service_provider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chromeos/dbus/dbus_thread_manager.h" 8 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
9 #include "chromeos/dbus/fake_bluetooth_gatt_manager_client.h" 9 #include "device/bluetooth/dbus/fake_bluetooth_gatt_manager_client.h"
10 10
11 namespace chromeos { 11 namespace bluez {
12 12
13 FakeBluetoothGattServiceServiceProvider:: 13 FakeBluetoothGattServiceServiceProvider::
14 FakeBluetoothGattServiceServiceProvider( 14 FakeBluetoothGattServiceServiceProvider(
15 const dbus::ObjectPath& object_path, 15 const dbus::ObjectPath& object_path,
16 const std::string& uuid, 16 const std::string& uuid,
17 const std::vector<dbus::ObjectPath>& includes) 17 const std::vector<dbus::ObjectPath>& includes)
18 : object_path_(object_path), 18 : object_path_(object_path), uuid_(uuid), includes_(includes) {
19 uuid_(uuid),
20 includes_(includes) {
21 VLOG(1) << "Creating Bluetooth GATT service: " << object_path_.value(); 19 VLOG(1) << "Creating Bluetooth GATT service: " << object_path_.value();
22 20
23 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client = 21 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
24 static_cast<FakeBluetoothGattManagerClient*>( 22 static_cast<FakeBluetoothGattManagerClient*>(
25 DBusThreadManager::Get()->GetBluetoothGattManagerClient()); 23 bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
26 fake_bluetooth_gatt_manager_client->RegisterServiceServiceProvider(this); 24 fake_bluetooth_gatt_manager_client->RegisterServiceServiceProvider(this);
27 } 25 }
28 26
29 FakeBluetoothGattServiceServiceProvider:: 27 FakeBluetoothGattServiceServiceProvider::
30 ~FakeBluetoothGattServiceServiceProvider() { 28 ~FakeBluetoothGattServiceServiceProvider() {
31 VLOG(1) << "Cleaning up Bluetooth GATT service: " << object_path_.value(); 29 VLOG(1) << "Cleaning up Bluetooth GATT service: " << object_path_.value();
32 30
33 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client = 31 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
34 static_cast<FakeBluetoothGattManagerClient*>( 32 static_cast<FakeBluetoothGattManagerClient*>(
35 DBusThreadManager::Get()->GetBluetoothGattManagerClient()); 33 bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
36 fake_bluetooth_gatt_manager_client->UnregisterServiceServiceProvider(this); 34 fake_bluetooth_gatt_manager_client->UnregisterServiceServiceProvider(this);
37 } 35 }
38 36
39 } // namespace chromeos 37 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698