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

Unified Diff: device/bluetooth/bluetooth_discovery_session.cc

Issue 188473002: device/bluetooth: Remove BluetoothAdapter::Start|StopDiscovering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed BluetoothAdapterWinTest compile errors. 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_chromeos_unittest.cc ('k') | device/bluetooth/test/mock_bluetooth_adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_discovery_session.cc
diff --git a/device/bluetooth/bluetooth_discovery_session.cc b/device/bluetooth/bluetooth_discovery_session.cc
index 6818a3c6a4fc4a335efeda3bd53329c0c3fe6b8b..ba5f5fdba64d2047a908d69cadc3b7cda2e4eebb 100644
--- a/device/bluetooth/bluetooth_discovery_session.cc
+++ b/device/bluetooth/bluetooth_discovery_session.cc
@@ -25,7 +25,7 @@ BluetoothDiscoverySession::~BluetoothDiscoverySession() {
return;
}
Stop(base::Bind(&base::DoNothing), base::Bind(&base::DoNothing));
- adapter_->DiscoverySessionDestroyed(this);
+ MarkAsInactive();
}
bool BluetoothDiscoverySession::IsActive() const {
@@ -50,12 +50,16 @@ void BluetoothDiscoverySession::Stop(
}
void BluetoothDiscoverySession::OnStop(const base::Closure& callback) {
- active_ = false;
+ MarkAsInactive();
callback.Run();
}
void BluetoothDiscoverySession::MarkAsInactive() {
+ if (!active_)
+ return;
active_ = false;
+ DCHECK(adapter_.get());
+ adapter_->DiscoverySessionBecameInactive(this);
}
} // namespace device
« no previous file with comments | « device/bluetooth/bluetooth_chromeos_unittest.cc ('k') | device/bluetooth/test/mock_bluetooth_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698