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

Unified Diff: trunk/src/device/bluetooth/bluetooth_discovery_session.cc

Issue 188663003: Revert 255262 "Migrate chrome.bluetooth API backend to use devic..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
Index: trunk/src/device/bluetooth/bluetooth_discovery_session.cc
===================================================================
--- trunk/src/device/bluetooth/bluetooth_discovery_session.cc (revision 255369)
+++ trunk/src/device/bluetooth/bluetooth_discovery_session.cc (working copy)
@@ -9,23 +9,13 @@
namespace device {
-BluetoothDiscoverySession::BluetoothDiscoverySession(
- scoped_refptr<BluetoothAdapter> adapter)
+BluetoothDiscoverySession::BluetoothDiscoverySession(BluetoothAdapter* adapter)
: active_(true),
adapter_(adapter),
weak_ptr_factory_(this) {
- DCHECK(adapter_.get());
}
-BluetoothDiscoverySession::BluetoothDiscoverySession()
- : active_(false),
- weak_ptr_factory_(this) {
-}
-
BluetoothDiscoverySession::~BluetoothDiscoverySession() {
- if (!active_)
- return;
- DCHECK(adapter_.get());
Stop(base::Bind(&base::DoNothing), base::Bind(&base::DoNothing));
adapter_->DiscoverySessionDestroyed(this);
}
@@ -38,12 +28,11 @@
const base::Closure& callback,
const ErrorCallback& error_callback) {
if (!active_) {
- LOG(WARNING) << "Discovery session not active. Cannot stop.";
+ LOG(ERROR) << "Discovery session not active. Cannot stop.";
error_callback.Run();
return;
}
VLOG(1) << "Stopping device discovery session.";
- DCHECK(adapter_.get());
adapter_->RemoveDiscoverySession(
base::Bind(&BluetoothDiscoverySession::OnStop,
weak_ptr_factory_.GetWeakPtr(),
« no previous file with comments | « trunk/src/device/bluetooth/bluetooth_discovery_session.h ('k') | trunk/src/device/bluetooth/test/mock_bluetooth_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698