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

Unified Diff: device/bluetooth/bluetooth_socket_thread.cc

Issue 276573004: Bluetooth: Implement new socket API for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DCHECK nits Created 6 years, 7 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_socket_thread.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_socket_thread.cc
diff --git a/device/bluetooth/bluetooth_socket_thread.cc b/device/bluetooth/bluetooth_socket_thread.cc
index 3f49d4156a9ef07feb787e9f9937cd3498788bf4..1f3b97bf98be34ca62c2f60911df727e5840b74f 100644
--- a/device/bluetooth/bluetooth_socket_thread.cc
+++ b/device/bluetooth/bluetooth_socket_thread.cc
@@ -21,10 +21,22 @@ scoped_refptr<BluetoothSocketThread> BluetoothSocketThread::Get() {
return g_instance.Get();
}
+// static
+void BluetoothSocketThread::CleanupForTesting() {
+ DCHECK(g_instance.Get());
+ g_instance.Get() = NULL;
+}
+
BluetoothSocketThread::BluetoothSocketThread()
: active_socket_count_(0) {}
-BluetoothSocketThread::~BluetoothSocketThread() {}
+BluetoothSocketThread::~BluetoothSocketThread() {
+ if (thread_) {
+ thread_->Stop();
+ thread_.reset(NULL);
+ task_runner_ = NULL;
+ }
+}
void BluetoothSocketThread::OnSocketActivate() {
DCHECK(thread_checker_.CalledOnValidThread());
« no previous file with comments | « device/bluetooth/bluetooth_socket_thread.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698