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

Unified Diff: device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_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_characteristic_service_provider.cc
diff --git a/chromeos/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc
similarity index 76%
rename from chromeos/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc
rename to device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc
index 5a548debf02fb73a86314ace9f86bd0b86275240..03f06d03cb61a2c26268d78dac890d1c4e824331 100644
--- a/chromeos/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc
+++ b/device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_service_provider.cc
@@ -2,14 +2,14 @@
// 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_characteristic_service_provider.h"
+#include "device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_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_manager_client.h"
+#include "device/bluetooth/dbus/bluez_dbus_manager.h"
+#include "device/bluetooth/dbus/fake_bluetooth_gatt_manager_client.h"
-namespace chromeos {
+namespace bluez {
FakeBluetoothGattCharacteristicServiceProvider::
FakeBluetoothGattCharacteristicServiceProvider(
@@ -19,27 +19,26 @@ FakeBluetoothGattCharacteristicServiceProvider::
const std::vector<std::string>& flags,
const std::vector<std::string>& permissions,
const dbus::ObjectPath& service_path)
- : object_path_(object_path),
- uuid_(uuid),
- service_path_(service_path),
- delegate_(delegate) {
+ : object_path_(object_path),
+ uuid_(uuid),
+ service_path_(service_path),
+ delegate_(delegate) {
VLOG(1) << "Creating Bluetooth GATT characteristic: " << object_path_.value();
DCHECK(object_path_.IsValid());
DCHECK(service_path_.IsValid());
DCHECK(!uuid.empty());
DCHECK(delegate_);
- DCHECK(base::StartsWith(object_path_.value(),
- service_path_.value() + "/",
+ DCHECK(base::StartsWith(object_path_.value(), service_path_.value() + "/",
base::CompareCase::SENSITIVE));
// TODO(armansito): Do something with |flags| and |permissions|.
FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
static_cast<FakeBluetoothGattManagerClient*>(
- DBusThreadManager::Get()->GetBluetoothGattManagerClient());
- fake_bluetooth_gatt_manager_client->
- RegisterCharacteristicServiceProvider(this);
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
+ fake_bluetooth_gatt_manager_client->RegisterCharacteristicServiceProvider(
+ this);
}
FakeBluetoothGattCharacteristicServiceProvider::
@@ -49,9 +48,9 @@ FakeBluetoothGattCharacteristicServiceProvider::
FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
static_cast<FakeBluetoothGattManagerClient*>(
- DBusThreadManager::Get()->GetBluetoothGattManagerClient());
- fake_bluetooth_gatt_manager_client->
- UnregisterCharacteristicServiceProvider(this);
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
+ fake_bluetooth_gatt_manager_client->UnregisterCharacteristicServiceProvider(
+ this);
}
void FakeBluetoothGattCharacteristicServiceProvider::SendValueChanged(
@@ -69,7 +68,7 @@ void FakeBluetoothGattCharacteristicServiceProvider::GetValue(
// Check if this characteristic is registered.
FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
static_cast<FakeBluetoothGattManagerClient*>(
- DBusThreadManager::Get()->GetBluetoothGattManagerClient());
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
if (!fake_bluetooth_gatt_manager_client->IsServiceRegistered(service_path_)) {
VLOG(1) << "GATT characteristic not registered.";
error_callback.Run();
@@ -91,7 +90,7 @@ void FakeBluetoothGattCharacteristicServiceProvider::SetValue(
// Check if this characteristic is registered.
FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
static_cast<FakeBluetoothGattManagerClient*>(
- DBusThreadManager::Get()->GetBluetoothGattManagerClient());
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
if (!fake_bluetooth_gatt_manager_client->IsServiceRegistered(service_path_)) {
VLOG(1) << "GATT characteristic not registered.";
error_callback.Run();
@@ -103,4 +102,4 @@ void FakeBluetoothGattCharacteristicServiceProvider::SetValue(
delegate_->SetCharacteristicValue(value, callback, error_callback);
}
-} // namespace chromeos
+} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698