Commit 47a991ea authored by Alex Turner's avatar Alex Turner Committed by Commit Bot

Migrate chromeos/attestation from base::Bind to Once/Repeating

base::Bind is deprecated and should be replaced with the more explicit
base::Bind{Once,Repeating}. The vast majority of this directory was
already migrated, but a few uses remained. We fix the remaining uses and
enable the presubmit to avoid any future regressions.

Bug: 1141533, 1007652
Change-Id: I18541dce79a90379bf2874e82b168fbf37d20ef9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2506049Reviewed-by: default avatarMattias Nissler <mnissler@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Alex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830205}
parent 744233a4
......@@ -370,7 +370,6 @@ _NOT_CONVERTED_TO_MODERN_BIND_AND_CALLBACK = '|'.join((
'^chrome/browser/web_applications/',
'^chrome/browser/win/',
'^chrome/test/chromedriver/server/http_handler.cc',
'^chromeos/attestation/',
'^chromeos/components/',
'^components/drive/',
'^components/search_engines/',
......
......@@ -45,7 +45,8 @@ class COMPONENT_EXPORT(CHROMEOS_ATTESTATION) ServerProxy {
// and the Chrome OS Privacy CA server. Sample usage:
//
// AttestationFlow flow(std::move(my_server_proxy));
// AttestationFlow::CertificateCallback callback = base::Bind(&MyCallback);
// AttestationFlow::CertificateCallback callback =
// base::BindOnce(&MyCallback);
// flow.GetCertificate(ENTERPRISE_USER_CERTIFICATE, false, callback);
//
// This class is not thread safe.
......
......@@ -276,8 +276,8 @@ TEST_F(AttestationFlowTest, GetCertificate_Attestation_Not_Prepared) {
AttestationFlow::CertificateCallback callback =
base::BindOnce(&AttestationFlowTest::QuitRunLoopCertificateCallback,
base::Unretained(this),
base::Bind(&MockObserver::MockCertificateCallback,
base::Unretained(&observer)));
base::BindOnce(&MockObserver::MockCertificateCallback,
base::Unretained(&observer)));
std::unique_ptr<ServerProxy> proxy_interface(proxy.release());
AttestationFlow flow(std::move(proxy_interface));
......@@ -318,8 +318,8 @@ TEST_F(AttestationFlowTest, GetCertificate_Attestation_Never_Prepared) {
AttestationFlow::CertificateCallback callback =
base::BindOnce(&AttestationFlowTest::QuitRunLoopCertificateCallback,
base::Unretained(this),
base::Bind(&MockObserver::MockCertificateCallback,
base::Unretained(&observer)));
base::BindOnce(&MockObserver::MockCertificateCallback,
base::Unretained(&observer)));
std::unique_ptr<ServerProxy> proxy_interface(proxy.release());
AttestationFlow flow(std::move(proxy_interface));
......@@ -353,8 +353,8 @@ TEST_F(AttestationFlowTest, GetCertificate_Attestation_Never_Confirm_Prepared) {
AttestationFlow::CertificateCallback callback =
base::BindOnce(&AttestationFlowTest::QuitRunLoopCertificateCallback,
base::Unretained(this),
base::Bind(&MockObserver::MockCertificateCallback,
base::Unretained(&observer)));
base::BindOnce(&MockObserver::MockCertificateCallback,
base::Unretained(&observer)));
std::unique_ptr<ServerProxy> proxy_interface(proxy.release());
AttestationFlow flow(std::move(proxy_interface));
......
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