Commit d570eecf authored by Etienne Pierre-doray's avatar Etienne Pierre-doray Committed by Commit Bot

[MessageLoop]: Replace MessageLoopCurrent::task_runner() in /base.

MessageLoopCurrent::task_runner() is depecated.
This CL replaces it with with ThreadTaskRunnerHandle::Get().
A small step towards deleting MessageLoop.

This CL was generated with git cl split.
Refer to the top-level CL if necessary :
https://chromium-review.googlesource.com/c/chromium/src/+/1631693

Please CQ if LGTY!

This CL was uploaded by git cl split.

R=ajwong@chromium.org

Bug: 616447
Change-Id: I0b6ecc3218f51dc3ae04f80d49ac374b33074bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635828
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Auto-Submit: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: default avatarAlbert J. Wong <ajwong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678343}
parent 7e1c3081
......@@ -51,11 +51,6 @@ void MessageLoopCurrent::RemoveDestructionObserver(
current_->RemoveDestructionObserver(destruction_observer);
}
scoped_refptr<SingleThreadTaskRunner> MessageLoopCurrent::task_runner() const {
DCHECK(current_->IsBoundToCurrentThread());
return current_->GetTaskRunner();
}
void MessageLoopCurrent::SetTaskRunner(
scoped_refptr<SingleThreadTaskRunner> task_runner) {
DCHECK(current_->IsBoundToCurrentThread());
......
......@@ -105,11 +105,6 @@ class BASE_EXPORT MessageLoopCurrent {
// DestructionObserver is receiving a notification callback.
void RemoveDestructionObserver(DestructionObserver* destruction_observer);
// Forwards to MessageLoop::task_runner().
// DEPRECATED(https://crbug.com/616447): Use ThreadTaskRunnerHandle::Get()
// instead of MessageLoopCurrent::Get()->task_runner().
scoped_refptr<SingleThreadTaskRunner> task_runner() const;
// Forwards to MessageLoop::SetTaskRunner().
// DEPRECATED(https://crbug.com/825327): only owners of the MessageLoop
// instance should replace its TaskRunner.
......
......@@ -17,6 +17,7 @@
#include "base/message_loop/message_loop_current.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/test/test_pending_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -24,7 +25,7 @@ namespace base {
namespace {
TaskRunner* GetCurrentTaskRunner() {
return MessageLoopCurrent::Get()->task_runner().get();
return ThreadTaskRunnerHandle::Get().get();
}
void AssignTrue(bool* out) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment