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

Unified Diff: device/bluetooth/bluetooth_adapter_profile_chromeos.cc

Issue 975323002: Revert of Fix BluetoothAdapterProfileChromeOS lifecycle management (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/bluetooth_adapter_profile_chromeos.cc
diff --git a/device/bluetooth/bluetooth_adapter_profile_chromeos.cc b/device/bluetooth/bluetooth_adapter_profile_chromeos.cc
index e8debcbc98749fded182d41c5c0551b02c7cf08e..2feff37aed352abdbf8c54b8f42ecd096f465639 100644
--- a/device/bluetooth/bluetooth_adapter_profile_chromeos.cc
+++ b/device/bluetooth/bluetooth_adapter_profile_chromeos.cc
@@ -20,27 +20,28 @@
// static
BluetoothAdapterProfileChromeOS* BluetoothAdapterProfileChromeOS::Register(
+ BluetoothAdapterChromeOS* adapter,
const device::BluetoothUUID& uuid,
const BluetoothProfileManagerClient::Options& options,
- const BluetoothAdapterChromeOS::ProfileRegisteredCallback& success_callback,
+ const base::Closure& success_callback,
const BluetoothProfileManagerClient::ErrorCallback& error_callback) {
+ DCHECK(adapter);
+
BluetoothAdapterProfileChromeOS* profile =
- new BluetoothAdapterProfileChromeOS(uuid);
+ new BluetoothAdapterProfileChromeOS(adapter, uuid);
VLOG(1) << "Registering profile: " << profile->object_path().value();
DBusThreadManager::Get()->GetBluetoothProfileManagerClient()->RegisterProfile(
- profile->object_path(),
- uuid.canonical_value(),
- options,
- base::Bind(success_callback, profile),
+ profile->object_path(), uuid.canonical_value(), options, success_callback,
error_callback);
return profile;
}
BluetoothAdapterProfileChromeOS::BluetoothAdapterProfileChromeOS(
+ BluetoothAdapterChromeOS* adapter,
const device::BluetoothUUID& uuid)
- : uuid_(uuid), weak_ptr_factory_(this) {
+ : uuid_(uuid), adapter_(adapter), weak_ptr_factory_(this) {
std::string uuid_path;
base::ReplaceChars(uuid.canonical_value(), ":-", "_", &uuid_path);
object_path_ =
@@ -53,6 +54,7 @@
}
BluetoothAdapterProfileChromeOS::~BluetoothAdapterProfileChromeOS() {
+ profile_.reset();
}
bool BluetoothAdapterProfileChromeOS::SetDelegate(
« no previous file with comments | « device/bluetooth/bluetooth_adapter_profile_chromeos.h ('k') | device/bluetooth/bluetooth_adapter_profile_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698