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

Unified Diff: device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_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, 3 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc
diff --git a/chromeos/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc b/device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc
similarity index 78%
rename from chromeos/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc
rename to device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc
index 9779c3aee0eae1d0d236809bf81d0888de3f43ec..4376ce982b134db4ff72e012b8312bdde3982230 100644
--- a/chromeos/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc
+++ b/device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chromeos/dbus/fake_bluetooth_gatt_descriptor_service_provider.h"
+#include "device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_service_provider.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
-#include "chromeos/dbus/dbus_thread_manager.h"
-#include "chromeos/dbus/fake_bluetooth_gatt_characteristic_service_provider.h"
-#include "chromeos/dbus/fake_bluetooth_gatt_manager_client.h"
+#include "device/bluetooth/dbus/bluez_dbus_manager.h"
+#include "device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.h"
+#include "device/bluetooth/dbus/fake_bluetooth_gatt_manager_client.h"
-namespace chromeos {
+namespace bluez {
FakeBluetoothGattDescriptorServiceProvider::
FakeBluetoothGattDescriptorServiceProvider(
@@ -19,10 +19,10 @@ FakeBluetoothGattDescriptorServiceProvider::
const std::string& uuid,
const std::vector<std::string>& permissions,
const dbus::ObjectPath& characteristic_path)
- : object_path_(object_path),
- uuid_(uuid),
- characteristic_path_(characteristic_path),
- delegate_(delegate) {
+ : object_path_(object_path),
+ uuid_(uuid),
+ characteristic_path_(characteristic_path),
+ delegate_(delegate) {
VLOG(1) << "Creating Bluetooth GATT descriptor: " << object_path_.value();
DCHECK(object_path_.IsValid());
@@ -37,21 +37,18 @@ FakeBluetoothGattDescriptorServiceProvider::
FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
static_cast<FakeBluetoothGattManagerClient*>(
- DBusThreadManager::Get()->GetBluetoothGattManagerClient());
- fake_bluetooth_gatt_manager_client->
- RegisterDescriptorServiceProvider(this);
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
+ fake_bluetooth_gatt_manager_client->RegisterDescriptorServiceProvider(this);
}
FakeBluetoothGattDescriptorServiceProvider::
~FakeBluetoothGattDescriptorServiceProvider() {
- VLOG(1) << "Cleaning up Bluetooth GATT descriptor: "
- << object_path_.value();
+ VLOG(1) << "Cleaning up Bluetooth GATT descriptor: " << object_path_.value();
FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
static_cast<FakeBluetoothGattManagerClient*>(
- DBusThreadManager::Get()->GetBluetoothGattManagerClient());
- fake_bluetooth_gatt_manager_client->
- UnregisterDescriptorServiceProvider(this);
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
+ fake_bluetooth_gatt_manager_client->UnregisterDescriptorServiceProvider(this);
}
void FakeBluetoothGattDescriptorServiceProvider::SendValueChanged(
@@ -69,7 +66,7 @@ void FakeBluetoothGattDescriptorServiceProvider::GetValue(
// Check if this descriptor is registered.
FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
static_cast<FakeBluetoothGattManagerClient*>(
- DBusThreadManager::Get()->GetBluetoothGattManagerClient());
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
FakeBluetoothGattCharacteristicServiceProvider* characteristic =
fake_bluetooth_gatt_manager_client->GetCharacteristicServiceProvider(
characteristic_path_);
@@ -100,7 +97,7 @@ void FakeBluetoothGattDescriptorServiceProvider::SetValue(
// Check if this descriptor is registered.
FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
static_cast<FakeBluetoothGattManagerClient*>(
- DBusThreadManager::Get()->GetBluetoothGattManagerClient());
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
FakeBluetoothGattCharacteristicServiceProvider* characteristic =
fake_bluetooth_gatt_manager_client->GetCharacteristicServiceProvider(
characteristic_path_);
@@ -121,4 +118,4 @@ void FakeBluetoothGattDescriptorServiceProvider::SetValue(
delegate_->SetDescriptorValue(value, callback, error_callback);
}
-} // namespace chromeos
+} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698