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

Unified Diff: device/bluetooth/dbus/bluetooth_media_endpoint_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_media_endpoint_service_provider.cc
diff --git a/chromeos/dbus/bluetooth_media_endpoint_service_provider.cc b/device/bluetooth/dbus/bluetooth_media_endpoint_service_provider.cc
similarity index 89%
rename from chromeos/dbus/bluetooth_media_endpoint_service_provider.cc
rename to device/bluetooth/dbus/bluetooth_media_endpoint_service_provider.cc
index 3d2e03edf3c4a424a84d22cd7948077719627473..864a04d103dd5403d8f97ebedc673d4afc52b4d4 100644
--- a/chromeos/dbus/bluetooth_media_endpoint_service_provider.cc
+++ b/device/bluetooth/dbus/bluetooth_media_endpoint_service_provider.cc
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chromeos/dbus/bluetooth_media_endpoint_service_provider.h"
+#include "device/bluetooth/dbus/bluetooth_media_endpoint_service_provider.h"
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/platform_thread.h"
-#include "chromeos/dbus/bluetooth_media_transport_client.h"
-#include "chromeos/dbus/dbus_thread_manager.h"
-#include "chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.h"
#include "dbus/exported_object.h"
+#include "device/bluetooth/dbus/bluetooth_media_transport_client.h"
+#include "device/bluetooth/dbus/bluez_dbus_manager.h"
+#include "device/bluetooth/dbus/fake_bluetooth_media_endpoint_service_provider.h"
namespace {
@@ -31,10 +31,10 @@ const char kInvalidState[] = "unknown";
} // namespace
-namespace chromeos {
+namespace bluez {
// The BluetoothMediaEndopintServiceProvider implementation used in production.
-class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl
+class DEVICE_BLUETOOTH_EXPORT BluetoothMediaEndpointServiceProviderImpl
: public BluetoothMediaEndpointServiceProvider {
public:
BluetoothMediaEndpointServiceProviderImpl(dbus::Bus* bus,
@@ -53,17 +53,14 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl
exported_object_ = bus_->GetExportedObject(object_path_);
exported_object_->ExportMethod(
- kBluetoothMediaEndpointInterface,
- kSetConfiguration,
- base::Bind(
- &BluetoothMediaEndpointServiceProviderImpl::SetConfiguration,
- weak_ptr_factory_.GetWeakPtr()),
+ kBluetoothMediaEndpointInterface, kSetConfiguration,
+ base::Bind(&BluetoothMediaEndpointServiceProviderImpl::SetConfiguration,
+ weak_ptr_factory_.GetWeakPtr()),
base::Bind(&BluetoothMediaEndpointServiceProviderImpl::OnExported,
weak_ptr_factory_.GetWeakPtr()));
exported_object_->ExportMethod(
- kBluetoothMediaEndpointInterface,
- kSelectConfiguration,
+ kBluetoothMediaEndpointInterface, kSelectConfiguration,
base::Bind(
&BluetoothMediaEndpointServiceProviderImpl::SelectConfiguration,
weak_ptr_factory_.GetWeakPtr()),
@@ -71,8 +68,7 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl
weak_ptr_factory_.GetWeakPtr()));
exported_object_->ExportMethod(
- kBluetoothMediaEndpointInterface,
- kClearConfiguration,
+ kBluetoothMediaEndpointInterface, kClearConfiguration,
base::Bind(
&BluetoothMediaEndpointServiceProviderImpl::ClearConfiguration,
weak_ptr_factory_.GetWeakPtr()),
@@ -80,8 +76,7 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl
weak_ptr_factory_.GetWeakPtr()));
exported_object_->ExportMethod(
- kBluetoothMediaEndpointInterface,
- kRelease,
+ kBluetoothMediaEndpointInterface, kRelease,
base::Bind(&BluetoothMediaEndpointServiceProviderImpl::Release,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&BluetoothMediaEndpointServiceProviderImpl::OnExported,
@@ -89,8 +84,7 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl
}
~BluetoothMediaEndpointServiceProviderImpl() override {
- VLOG(1) << "Cleaning up Bluetooth Media Endpoint: "
- << object_path_.value();
+ VLOG(1) << "Cleaning up Bluetooth Media Endpoint: " << object_path_.value();
bus_->UnregisterExportedObject(object_path_);
}
@@ -198,9 +192,7 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl
// back via |callback|.
Delegate::SelectConfigurationCallback callback = base::Bind(
&BluetoothMediaEndpointServiceProviderImpl::OnConfiguration,
- weak_ptr_factory_.GetWeakPtr(),
- method_call,
- response_sender);
+ weak_ptr_factory_.GetWeakPtr(), method_call, response_sender);
delegate_->SelectConfiguration(configuration, callback);
}
@@ -293,33 +285,29 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl
BluetoothMediaEndpointServiceProvider::Delegate::TransportProperties::
TransportProperties()
- : codec(kInvalidCodec),
- state(kInvalidState) {
-}
+ : codec(kInvalidCodec), state(kInvalidState) {}
BluetoothMediaEndpointServiceProvider::Delegate::TransportProperties::
- ~TransportProperties() {
-}
+ ~TransportProperties() {}
BluetoothMediaEndpointServiceProvider::BluetoothMediaEndpointServiceProvider() {
}
BluetoothMediaEndpointServiceProvider::
- ~BluetoothMediaEndpointServiceProvider() {
-}
+ ~BluetoothMediaEndpointServiceProvider() {}
BluetoothMediaEndpointServiceProvider*
- BluetoothMediaEndpointServiceProvider::Create(
+BluetoothMediaEndpointServiceProvider::Create(
dbus::Bus* bus,
const dbus::ObjectPath& object_path,
Delegate* delegate) {
// Returns a real implementation.
- if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) {
- return new BluetoothMediaEndpointServiceProviderImpl(
- bus, object_path, delegate);
+ if (!bluez::BluezDBusManager::Get()->IsUsingStub()) {
+ return new BluetoothMediaEndpointServiceProviderImpl(bus, object_path,
+ delegate);
}
// Returns a fake implementation.
return new FakeBluetoothMediaEndpointServiceProvider(object_path, delegate);
}
-} // namespace chromeos
+} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698