Commit ad9f98b2 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Convert base::Callback in chrome/browser/google

This is a code health CL, no behavior change is expected.

Bug: 1007635
Change-Id: I04d345d6340a7b72c55201fa52c6848aaf076378
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2277677Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784875}
parent 384e240d
......@@ -935,14 +935,14 @@ base::Optional<UpdateState> GetLastUpdateState() {
// Private API exposed for testing. --------------------------------------------
void SetGoogleUpdateFactoryForTesting(
const GoogleUpdate3ClassFactory& google_update_factory) {
GoogleUpdate3ClassFactory google_update_factory) {
if (g_google_update_factory) {
delete g_google_update_factory;
g_google_update_factory = nullptr;
}
if (!google_update_factory.is_null()) {
g_google_update_factory =
new GoogleUpdate3ClassFactory(google_update_factory);
new GoogleUpdate3ClassFactory(std::move(google_update_factory));
}
}
......
......@@ -133,13 +133,13 @@ base::Optional<UpdateState> GetLastUpdateState();
// A type of callback supplied by tests to provide a custom IGoogleUpdate3Web
// implementation (see src/google_update/google_update_idl.idl).
typedef base::Callback<HRESULT(Microsoft::WRL::ComPtr<IGoogleUpdate3Web>*)>
GoogleUpdate3ClassFactory;
using GoogleUpdate3ClassFactory = base::RepeatingCallback<HRESULT(
Microsoft::WRL::ComPtr<IGoogleUpdate3Web>*)>;
// For use by tests that wish to provide a custom IGoogleUpdate3Web
// implementation independent of Google Update's.
void SetGoogleUpdateFactoryForTesting(
const GoogleUpdate3ClassFactory& google_update_factory);
GoogleUpdate3ClassFactory google_update_factory);
void SetUpdateDriverTaskRunnerForTesting(
base::SingleThreadTaskRunner* task_runner);
......
......@@ -595,8 +595,8 @@ class GoogleUpdateWinTest : public ::testing::TestWithParam<bool> {
// Provide an IGoogleUpdate3Web class factory so that this test can provide
// a mocked-out instance.
SetGoogleUpdateFactoryForTesting(
base::Bind(&GoogleUpdateFactory::Create,
base::Unretained(&mock_google_update_factory_)));
base::BindRepeating(&GoogleUpdateFactory::Create,
base::Unretained(&mock_google_update_factory_)));
// Compute a newer version.
base::Version current_version(CHROME_VERSION_STRING);
......
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