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

[MessageLoop]: Replace RunLoop-related ScopedNestableTaskAllower in /base.

This CL replaces ScopedNestableTaskAllower with kNestableTasksAllowed passed
as argument to the RunLoop involved if any.
Only native nested loops should use ScopedNestableTaskAllower (soon to be deprecated).
For more details, see:
https://cs.chromium.org/chromium/src/base/message_loop/message_loop_current.h?sq=package:chromium&dr=CSs&g=0&l=159

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/+/1635819

Please CQ if LGTY!

This CL was uploaded by git cl split.

R=thestig@chromium.org

Bug: 766678
Change-Id: I6624b7e20ad6d7852fa91151ddd149932cebe516
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636056
Auto-Submit: Etienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664806}
parent cb872f62
...@@ -594,12 +594,11 @@ void ScopedTaskEnvironment::RunUntilIdle() { ...@@ -594,12 +594,11 @@ void ScopedTaskEnvironment::RunUntilIdle() {
} }
void ScopedTaskEnvironment::FastForwardBy(TimeDelta delta) { void ScopedTaskEnvironment::FastForwardBy(TimeDelta delta) {
MessageLoopCurrent::ScopedNestableTaskAllower allow;
DCHECK(mock_time_domain_); DCHECK(mock_time_domain_);
mock_time_domain_->SetStopWhenMessagePumpIsIdle(false); mock_time_domain_->SetStopWhenMessagePumpIsIdle(false);
mock_time_domain_->SetAllowTimeToAutoAdvanceUntil(mock_time_domain_->Now() + mock_time_domain_->SetAllowTimeToAutoAdvanceUntil(mock_time_domain_->Now() +
delta); delta);
RunLoop().RunUntilIdle(); RunLoop{RunLoop::Type::kNestableTasksAllowed}.RunUntilIdle();
mock_time_domain_->SetStopWhenMessagePumpIsIdle(true); mock_time_domain_->SetStopWhenMessagePumpIsIdle(true);
mock_time_domain_->SetAllowTimeToAutoAdvanceUntil(TimeTicks::Max()); mock_time_domain_->SetAllowTimeToAutoAdvanceUntil(TimeTicks::Max());
} }
......
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