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

Unified Diff: components/proximity_auth/bluetooth_connection.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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
Index: components/proximity_auth/bluetooth_connection.cc
diff --git a/components/proximity_auth/bluetooth_connection.cc b/components/proximity_auth/bluetooth_connection.cc
index 435793eeab2b752f8110770ab3707ea861274282..f038564a1d67aacad52d6786f9775351c1aec32c 100644
--- a/components/proximity_auth/bluetooth_connection.cc
+++ b/components/proximity_auth/bluetooth_connection.cc
@@ -5,8 +5,10 @@
#include "components/proximity_auth/bluetooth_connection.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
#include "base/numerics/safe_conversions.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "components/proximity_auth/remote_device.h"
#include "components/proximity_auth/wire_message.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
@@ -169,10 +171,9 @@ void BluetoothConnection::OnReceive(int bytes_received,
// Post a task to delay the read until the socket is available, as
// calling StartReceive at this point would error with ERR_IO_PENDING.
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&BluetoothConnection::StartReceive,
- weak_ptr_factory_.GetWeakPtr()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&BluetoothConnection::StartReceive,
+ weak_ptr_factory_.GetWeakPtr()));
}
void BluetoothConnection::OnReceiveError(
@@ -182,10 +183,9 @@ void BluetoothConnection::OnReceiveError(
// Post a task to delay the read until the socket is available, as
// calling StartReceive at this point would error with ERR_IO_PENDING.
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&BluetoothConnection::StartReceive,
- weak_ptr_factory_.GetWeakPtr()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&BluetoothConnection::StartReceive,
+ weak_ptr_factory_.GetWeakPtr()));
}
} // namespace proximity_auth
« no previous file with comments | « components/printing/test/print_mock_render_thread.cc ('k') | components/proximity_auth/bluetooth_connection_finder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698