| 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..e1a2a4f379fd92ac18ff9661cb1cae27a5c363c8 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,7 +31,7 @@ const char kInvalidState[] = "unknown";
|
|
|
| } // namespace
|
|
|
| -namespace chromeos {
|
| +namespace bluez {
|
|
|
| // The BluetoothMediaEndopintServiceProvider implementation used in production.
|
| class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl
|
| @@ -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
|
|
|