[Passwords] Fix a crash in HttpCredentialCleaner

HttpCredentialCleaner tried to use the PrefService in a posted task.
This caused a use-after-free when the DestroyProfileOnBrowserClose
flag was enabled.

Make CredentialsCleanerRunner a KeyedService, so its lifetime (and its
attached HttpCredentialCleaner) is tied to the Profile's lifetime,
letting us avoid the crash by using WeakPtrs.

Bug: 88586, 1141055
Change-Id: I77ebd7daa87257d562c9c12bf63681f16ffc2d10
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2511073
Commit-Queue: Nicolas Ouellet-Payeur <[email protected]>
Reviewed-by: Jan Wilken Dörrie <[email protected]>
Reviewed-by: Ioana Pandele <[email protected]>
Cr-Commit-Position: refs/heads/master@{#826437}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index b2e4bb3..4ac8c772 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1059,6 +1059,8 @@
     "password_manager/chrome_biometric_authenticator.h",
     "password_manager/chrome_password_manager_client.cc",
     "password_manager/chrome_password_manager_client.h",
+    "password_manager/credentials_cleaner_runner_factory.cc",
+    "password_manager/credentials_cleaner_runner_factory.h",
     "password_manager/field_info_manager_factory.cc",
     "password_manager/field_info_manager_factory.h",
     "password_manager/password_store_factory.cc",