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

Unified Diff: device/bluetooth/bluetooth_adapter.cc

Issue 188473002: device/bluetooth: Remove BluetoothAdapter::Start|StopDiscovering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed potential invalid access in BluetoothDiscoverySession destructor. Created 6 years, 9 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
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_chromeos_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter.cc
diff --git a/device/bluetooth/bluetooth_adapter.cc b/device/bluetooth/bluetooth_adapter.cc
index 286815970dc7ec753539de13b45a8e3472a33369..fa66b5d5e30d4a8f6767905a3d651988456f8b47 100644
--- a/device/bluetooth/bluetooth_adapter.cc
+++ b/device/bluetooth/bluetooth_adapter.cc
@@ -29,16 +29,6 @@ void BluetoothAdapter::StartDiscoverySession(
error_callback);
}
-void BluetoothAdapter::StartDiscovering(const base::Closure& callback,
- const ErrorCallback& error_callback) {
- AddDiscoverySession(callback, error_callback);
-}
-
-void BluetoothAdapter::StopDiscovering(const base::Closure& callback,
- const ErrorCallback& error_callback) {
- RemoveDiscoverySession(callback, error_callback);
-}
-
BluetoothAdapter::DeviceList BluetoothAdapter::GetDevices() {
ConstDeviceList const_devices =
const_cast<const BluetoothAdapter *>(this)->GetDevices();
@@ -124,6 +114,9 @@ void BluetoothAdapter::MarkDiscoverySessionsAsInactive() {
iter != discovery_sessions_.end(); ++iter) {
(*iter)->MarkAsInactive();
}
+ // At this point, all sessions have been marked as inactive. Just remove them
+ // from our list as they are no longer relevant.
+ discovery_sessions_.clear();
keybuk 2014/03/06 18:42:36 This seems to contradict the comment in the header
armansito 2014/03/06 23:55:48 Well, it doesn't really contradict it, as discover
keybuk 2014/03/06 23:57:39 because we're dealing with object lifetime, I thin
armansito 2014/03/07 19:22:16 Actually they weren't removed when an individual o
}
void BluetoothAdapter::DiscoverySessionDestroyed(
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698