Commit ad2b0436 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate MessageLoop::current() to MessageLoopCurrent in /chromeos/attestation

These changes were scripted as part of the effort to restrict exposure of the
raw MessageLoop*.

Note that many static methods exposed on MessageLoopCurrent are also deprecated
so it is very well possible that this is migrating to an already deprecated
method.

The goal of this pass is to reduce usage of MessageLoop::current() (and
ultimately make it impossible to obtain the MessageLoop* statically).

As such I will not edit this CL unless the script did something logically wrong.
I defer to owners to fix highlighted usage of already deprecated APIs.

Possible script screw ups / things to look out for in this review:
 - Storing MessageLoopCurrent in a MessageLoop* variable or comparing it against
   one (I will go over that in a separate pass).

Includes should have been stripped if that was the last usage of message_loop.h
in that file.

Please CQ if LGTY

This CL was uploaded by git cl split.

R=mnissler@chromium.org

Bug: 825327
Change-Id: If841fcb08116a6b73fe0af84c94dd4f17ac9c290
Reviewed-on: https://chromium-review.googlesource.com/1024492
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarMattias Nissler <mnissler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553593}
parent 1c4ab889
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_current.h"
#include "base/optional.h" #include "base/optional.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "chromeos/cryptohome/async_method_caller.h" #include "chromeos/cryptohome/async_method_caller.h"
...@@ -327,7 +327,7 @@ void AttestationFlow::CheckAttestationReadyAndReschedule( ...@@ -327,7 +327,7 @@ void AttestationFlow::CheckAttestationReadyAndReschedule(
if (base::TimeTicks::Now() < end_time) { if (base::TimeTicks::Now() < end_time) {
LOG(WARNING) << "Attestation: Not prepared yet." LOG(WARNING) << "Attestation: Not prepared yet."
<< " Retrying in " << retry_delay_ << "."; << " Retrying in " << retry_delay_ << ".";
base::MessageLoop::current()->task_runner()->PostDelayedTask( base::MessageLoopCurrent::Get()->task_runner()->PostDelayedTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&AttestationFlow::WaitForAttestationReadyAndStartEnroll, base::BindOnce(&AttestationFlow::WaitForAttestationReadyAndStartEnroll,
weak_factory_.GetWeakPtr(), end_time, on_failure, weak_factory_.GetWeakPtr(), end_time, on_failure,
......
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