| Index: components/pairing/fake_controller_pairing_controller.cc
|
| diff --git a/components/pairing/fake_controller_pairing_controller.cc b/components/pairing/fake_controller_pairing_controller.cc
|
| index 89a076103eddc459281b5fa6992e879f421e556c..24069e23776187716dfdaa0f58527aa3bc16ae94 100644
|
| --- a/components/pairing/fake_controller_pairing_controller.cc
|
| +++ b/components/pairing/fake_controller_pairing_controller.cc
|
| @@ -7,12 +7,14 @@
|
| #include <map>
|
|
|
| #include "base/bind.h"
|
| +#include "base/location.h"
|
| #include "base/logging.h"
|
| -#include "base/message_loop/message_loop.h"
|
| #include "base/rand_util.h"
|
| +#include "base/single_thread_task_runner.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_split.h"
|
| #include "base/strings/string_util.h"
|
| +#include "base/threading/thread_task_runner_handle.h"
|
|
|
| namespace pairing_chromeos {
|
|
|
| @@ -235,11 +237,9 @@ void FakeControllerPairingController::ChangeStage(Stage new_stage) {
|
| }
|
|
|
| void FakeControllerPairingController::ChangeStageLater(Stage new_stage) {
|
| - base::MessageLoop::current()->PostDelayedTask(
|
| - FROM_HERE,
|
| - base::Bind(&FakeControllerPairingController::ChangeStage,
|
| - base::Unretained(this),
|
| - new_stage),
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| + FROM_HERE, base::Bind(&FakeControllerPairingController::ChangeStage,
|
| + base::Unretained(this), new_stage),
|
| async_duration_);
|
| }
|
|
|
| @@ -266,11 +266,10 @@ void FakeControllerPairingController::ExecuteDiscoveryEvent(
|
| if (++event_position == discovery_scenario_.size()) {
|
| return;
|
| }
|
| - base::MessageLoop::current()->PostDelayedTask(
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| FROM_HERE,
|
| base::Bind(&FakeControllerPairingController::ExecuteDiscoveryEvent,
|
| - base::Unretained(this),
|
| - event_position),
|
| + base::Unretained(this), event_position),
|
| async_duration_);
|
| }
|
|
|
| @@ -292,11 +291,10 @@ void FakeControllerPairingController::PairingStageChanged(Stage new_stage) {
|
| switch (new_stage) {
|
| case STAGE_DEVICES_DISCOVERY: {
|
| discovered_devices_.clear();
|
| - base::MessageLoop::current()->PostDelayedTask(
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| FROM_HERE,
|
| base::Bind(&FakeControllerPairingController::ExecuteDiscoveryEvent,
|
| - base::Unretained(this),
|
| - 0),
|
| + base::Unretained(this), 0),
|
| async_duration_);
|
| break;
|
| }
|
|
|