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

Unified Diff: device/bluetooth/dbus/bluetooth_profile_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/bluetooth_profile_service_provider.cc
diff --git a/chromeos/dbus/bluetooth_profile_service_provider.cc b/device/bluetooth/dbus/bluetooth_profile_service_provider.cc
similarity index 93%
rename from chromeos/dbus/bluetooth_profile_service_provider.cc
rename to device/bluetooth/dbus/bluetooth_profile_service_provider.cc
index c74da5d1bb3c2f4b492907b510a93a1181a39934..a2a23bb81cbf7f0dc84997437ce676cd2ac63974 100644
--- a/chromeos/dbus/bluetooth_profile_service_provider.cc
+++ b/device/bluetooth/dbus/bluetooth_profile_service_provider.cc
@@ -2,20 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chromeos/dbus/bluetooth_profile_service_provider.h"
-
+#include "device/bluetooth/dbus/bluetooth_profile_service_provider.h"
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/threading/platform_thread.h"
-#include "chromeos/dbus/dbus_thread_manager.h"
-#include "chromeos/dbus/fake_bluetooth_profile_service_provider.h"
#include "dbus/exported_object.h"
#include "dbus/message.h"
+#include "device/bluetooth/dbus/bluez_dbus_manager.h"
+#include "device/bluetooth/dbus/fake_bluetooth_profile_service_provider.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
-namespace chromeos {
+namespace bluez {
// The BluetoothProfileServiceProvider implementation used in production.
class BluetoothProfileServiceProviderImpl
@@ -128,9 +127,7 @@ class BluetoothProfileServiceProviderImpl
Delegate::ConfirmationCallback callback = base::Bind(
&BluetoothProfileServiceProviderImpl::OnConfirmation,
- weak_ptr_factory_.GetWeakPtr(),
- method_call,
- response_sender);
+ weak_ptr_factory_.GetWeakPtr(), method_call, response_sender);
delegate_->NewConnection(device_path, fd.Pass(), options, callback);
}
@@ -153,9 +150,7 @@ class BluetoothProfileServiceProviderImpl
Delegate::ConfirmationCallback callback = base::Bind(
&BluetoothProfileServiceProviderImpl::OnConfirmation,
- weak_ptr_factory_.GetWeakPtr(),
- method_call,
- response_sender);
+ weak_ptr_factory_.GetWeakPtr(), method_call, response_sender);
delegate_->RequestDisconnection(device_path, callback);
}
@@ -176,8 +171,8 @@ class BluetoothProfileServiceProviderImpl
void OnExported(const std::string& interface_name,
const std::string& method_name,
bool success) {
- LOG_IF(WARNING, !success) << "Failed to export "
- << interface_name << "." << method_name;
+ LOG_IF(WARNING, !success) << "Failed to export " << interface_name << "."
+ << method_name;
}
// Called by the Delegate in response to a method requiring confirmation.
@@ -234,22 +229,20 @@ class BluetoothProfileServiceProviderImpl
DISALLOW_COPY_AND_ASSIGN(BluetoothProfileServiceProviderImpl);
};
-BluetoothProfileServiceProvider::BluetoothProfileServiceProvider() {
-}
+BluetoothProfileServiceProvider::BluetoothProfileServiceProvider() {}
-BluetoothProfileServiceProvider::~BluetoothProfileServiceProvider() {
-}
+BluetoothProfileServiceProvider::~BluetoothProfileServiceProvider() {}
// static
BluetoothProfileServiceProvider* BluetoothProfileServiceProvider::Create(
dbus::Bus* bus,
const dbus::ObjectPath& object_path,
Delegate* delegate) {
- if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) {
+ if (!bluez::BluezDBusManager::Get()->IsUsingStub()) {
return new BluetoothProfileServiceProviderImpl(bus, object_path, delegate);
} else {
return new FakeBluetoothProfileServiceProvider(object_path, delegate);
}
}
-} // namespace chromeos
+} // namespace bluez
« no previous file with comments | « device/bluetooth/dbus/bluetooth_profile_service_provider.h ('k') | device/bluetooth/dbus/bluez_dbus_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698