| Index: chrome/browser/prefs/pref_hash_calculator.cc
|
| diff --git a/chrome/browser/prefs/pref_hash_calculator.cc b/chrome/browser/prefs/pref_hash_calculator.cc
|
| index 3fd951bcd237171ac5e783a51739b86eda49f58e..2f36018a11fd129e298cbf7a8f2fe219bf2f8054 100644
|
| --- a/chrome/browser/prefs/pref_hash_calculator.cc
|
| +++ b/chrome/browser/prefs/pref_hash_calculator.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/logging.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_util.h"
|
| +#include "base/threading/thread_restrictions.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/prefs/tracked/pref_hash_calculator_helper.h"
|
| #include "crypto/hmac.h"
|
| @@ -137,6 +138,16 @@ PrefHashCalculator::ValidationResult PrefHashCalculator::Validate(
|
|
|
| std::string PrefHashCalculator::RetrieveLegacyDeviceId() const {
|
| if (!legacy_device_id_instance_) {
|
| + // Allow IO on this thread to retrieve the legacy device ID. The result of
|
| + // this operation is stored in |legacy_device_id_instance_| and will thus
|
| + // only happen at most once per PrefHashCalculator. This is not ideal, but
|
| + // this value is required synchronously to be able to continue loading prefs
|
| + // for this profile. This profile should then be migrated to a modern device
|
| + // ID and subsequent loads of this profile shouldn't need to run this code
|
| + // ever again.
|
| + // TODO(gab): Remove this when the legacy device ID (M33) becomes
|
| + // irrelevant.
|
| + base::ThreadRestrictions::ScopedAllowIO allow_io;
|
| legacy_device_id_instance_.reset(
|
| new std::string(GenerateDeviceIdLikePrefMetricsServiceDid(
|
| get_legacy_device_id_callback_.Run(raw_device_id_))));
|
|
|