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

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_le_advertisement_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/dbus_thread_manager.h" 5 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
6 #include "chromeos/dbus/fake_bluetooth_le_advertisement_service_provider.h" 6 #include "device/bluetooth/dbus/fake_bluetooth_le_advertisement_service_provider .h"
7 #include "chromeos/dbus/fake_bluetooth_le_advertising_manager_client.h" 7 #include "device/bluetooth/dbus/fake_bluetooth_le_advertising_manager_client.h"
8 8
9 namespace chromeos { 9 namespace bluez {
10 10
11 FakeBluetoothLEAdvertisementServiceProvider:: 11 FakeBluetoothLEAdvertisementServiceProvider::
12 FakeBluetoothLEAdvertisementServiceProvider( 12 FakeBluetoothLEAdvertisementServiceProvider(
13 const dbus::ObjectPath& object_path, 13 const dbus::ObjectPath& object_path,
14 Delegate* delegate) 14 Delegate* delegate)
15 : delegate_(delegate) { 15 : delegate_(delegate) {
16 object_path_ = object_path; 16 object_path_ = object_path;
17 VLOG(1) << "Creating Bluetooth Advertisement: " << object_path_.value(); 17 VLOG(1) << "Creating Bluetooth Advertisement: " << object_path_.value();
18 18
19 FakeBluetoothLEAdvertisingManagerClient* 19 FakeBluetoothLEAdvertisingManagerClient*
20 fake_bluetooth_profile_manager_client = 20 fake_bluetooth_profile_manager_client =
21 static_cast<FakeBluetoothLEAdvertisingManagerClient*>( 21 static_cast<FakeBluetoothLEAdvertisingManagerClient*>(
22 DBusThreadManager::Get() 22 bluez::BluezDBusManager::Get()
23 ->GetBluetoothLEAdvertisingManagerClient()); 23 ->GetBluetoothLEAdvertisingManagerClient());
24 fake_bluetooth_profile_manager_client->RegisterAdvertisementServiceProvider( 24 fake_bluetooth_profile_manager_client->RegisterAdvertisementServiceProvider(
25 this); 25 this);
26 } 26 }
27 27
28 FakeBluetoothLEAdvertisementServiceProvider:: 28 FakeBluetoothLEAdvertisementServiceProvider::
29 ~FakeBluetoothLEAdvertisementServiceProvider() { 29 ~FakeBluetoothLEAdvertisementServiceProvider() {
30 VLOG(1) << "Cleaning up Bluetooth Advertisement: " << object_path_.value(); 30 VLOG(1) << "Cleaning up Bluetooth Advertisement: " << object_path_.value();
31 31
32 FakeBluetoothLEAdvertisingManagerClient* 32 FakeBluetoothLEAdvertisingManagerClient*
33 fake_bluetooth_profile_manager_client = 33 fake_bluetooth_profile_manager_client =
34 static_cast<FakeBluetoothLEAdvertisingManagerClient*>( 34 static_cast<FakeBluetoothLEAdvertisingManagerClient*>(
35 DBusThreadManager::Get() 35 bluez::BluezDBusManager::Get()
36 ->GetBluetoothLEAdvertisingManagerClient()); 36 ->GetBluetoothLEAdvertisingManagerClient());
37 fake_bluetooth_profile_manager_client->UnregisterAdvertisementServiceProvider( 37 fake_bluetooth_profile_manager_client->UnregisterAdvertisementServiceProvider(
38 this); 38 this);
39 } 39 }
40 40
41 void FakeBluetoothLEAdvertisementServiceProvider::Release() { 41 void FakeBluetoothLEAdvertisementServiceProvider::Release() {
42 VLOG(1) << object_path_.value() << ": Release"; 42 VLOG(1) << object_path_.value() << ": Release";
43 delegate_->Released(); 43 delegate_->Released();
44 } 44 }
45 45
46 } // namespace chromeos 46 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698