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

Unified Diff: device/bluetooth/dbus/bluetooth_profile_manager_client.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_manager_client.cc
diff --git a/chromeos/dbus/bluetooth_profile_manager_client.cc b/device/bluetooth/dbus/bluetooth_profile_manager_client.cc
similarity index 90%
rename from chromeos/dbus/bluetooth_profile_manager_client.cc
rename to device/bluetooth/dbus/bluetooth_profile_manager_client.cc
index 85945bca858de0920c9c3a0289da3d104af69359..742988a535e26c24841871fdf7db815946fab1ef 100644
--- a/chromeos/dbus/bluetooth_profile_manager_client.cc
+++ b/device/bluetooth/dbus/bluetooth_profile_manager_client.cc
@@ -2,7 +2,7 @@
// 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_manager_client.h"
+#include "device/bluetooth/dbus/bluetooth_profile_manager_client.h"
#include "base/bind.h"
#include "base/logging.h"
@@ -11,21 +11,17 @@
#include "dbus/object_proxy.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
-namespace chromeos {
+namespace bluez {
const char BluetoothProfileManagerClient::kNoResponseError[] =
"org.chromium.Error.NoResponse";
+BluetoothProfileManagerClient::Options::Options() {}
-BluetoothProfileManagerClient::Options::Options() {
-}
-
-BluetoothProfileManagerClient::Options::~Options() {
-}
+BluetoothProfileManagerClient::Options::~Options() {}
// The BluetoothProfileManagerClient implementation used in production.
-class BluetoothProfileManagerClientImpl
- : public BluetoothProfileManagerClient {
+class BluetoothProfileManagerClientImpl : public BluetoothProfileManagerClient {
public:
BluetoothProfileManagerClientImpl() : weak_ptr_factory_(this) {}
@@ -38,8 +34,8 @@ class BluetoothProfileManagerClientImpl
const base::Closure& callback,
const ErrorCallback& error_callback) override {
dbus::MethodCall method_call(
- bluetooth_profile_manager::kBluetoothProfileManagerInterface,
- bluetooth_profile_manager::kRegisterProfile);
+ bluetooth_profile_manager::kBluetoothProfileManagerInterface,
+ bluetooth_profile_manager::kRegisterProfile);
dbus::MessageWriter writer(&method_call);
writer.AppendObjectPath(profile_path);
@@ -122,8 +118,7 @@ class BluetoothProfileManagerClientImpl
// Send AutoConnect if provided.
if (options.auto_connect.get() != NULL) {
array_writer.OpenDictEntry(&dict_writer);
- dict_writer.AppendString(
- bluetooth_profile_manager::kAutoConnectOption);
+ dict_writer.AppendString(bluetooth_profile_manager::kAutoConnectOption);
dict_writer.AppendVariantOfBool(*(options.auto_connect));
array_writer.CloseContainer(&dict_writer);
}
@@ -158,8 +153,7 @@ class BluetoothProfileManagerClientImpl
writer.CloseContainer(&array_writer);
object_proxy_->CallMethodWithErrorCallback(
- &method_call,
- dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&BluetoothProfileManagerClientImpl::OnSuccess,
weak_ptr_factory_.GetWeakPtr(), callback),
base::Bind(&BluetoothProfileManagerClientImpl::OnError,
@@ -171,15 +165,14 @@ class BluetoothProfileManagerClientImpl
const base::Closure& callback,
const ErrorCallback& error_callback) override {
dbus::MethodCall method_call(
- bluetooth_profile_manager::kBluetoothProfileManagerInterface,
- bluetooth_profile_manager::kUnregisterProfile);
+ bluetooth_profile_manager::kBluetoothProfileManagerInterface,
+ bluetooth_profile_manager::kUnregisterProfile);
dbus::MessageWriter writer(&method_call);
writer.AppendObjectPath(profile_path);
object_proxy_->CallMethodWithErrorCallback(
- &method_call,
- dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&BluetoothProfileManagerClientImpl::OnSuccess,
weak_ptr_factory_.GetWeakPtr(), callback),
base::Bind(&BluetoothProfileManagerClientImpl::OnError,
@@ -197,8 +190,7 @@ class BluetoothProfileManagerClientImpl
private:
// Called when a response for successful method call is received.
- void OnSuccess(const base::Closure& callback,
- dbus::Response* response) {
+ void OnSuccess(const base::Closure& callback, dbus::Response* response) {
DCHECK(response);
callback.Run();
}
@@ -231,14 +223,12 @@ class BluetoothProfileManagerClientImpl
DISALLOW_COPY_AND_ASSIGN(BluetoothProfileManagerClientImpl);
};
-BluetoothProfileManagerClient::BluetoothProfileManagerClient() {
-}
+BluetoothProfileManagerClient::BluetoothProfileManagerClient() {}
-BluetoothProfileManagerClient::~BluetoothProfileManagerClient() {
-}
+BluetoothProfileManagerClient::~BluetoothProfileManagerClient() {}
BluetoothProfileManagerClient* BluetoothProfileManagerClient::Create() {
return new BluetoothProfileManagerClientImpl();
}
-} // namespace chromeos
+} // namespace bluez
« no previous file with comments | « device/bluetooth/dbus/bluetooth_profile_manager_client.h ('k') | device/bluetooth/dbus/bluetooth_profile_service_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698