| Index: components/user_prefs/tracked/pref_hash_store_impl.cc
|
| diff --git a/chrome/browser/prefs/tracked/pref_hash_store_impl.cc b/components/user_prefs/tracked/pref_hash_store_impl.cc
|
| similarity index 92%
|
| rename from chrome/browser/prefs/tracked/pref_hash_store_impl.cc
|
| rename to components/user_prefs/tracked/pref_hash_store_impl.cc
|
| index f43e06b13ed91c55cb9cd3a3b00ee723ef768336..dd862221d57e5683ac88ddd3428d7e241769940c 100644
|
| --- a/chrome/browser/prefs/tracked/pref_hash_store_impl.cc
|
| +++ b/components/user_prefs/tracked/pref_hash_store_impl.cc
|
| @@ -2,13 +2,13 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/prefs/tracked/pref_hash_store_impl.h"
|
| +#include "components/user_prefs/tracked/pref_hash_store_impl.h"
|
|
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/values.h"
|
| -#include "chrome/browser/prefs/tracked/hash_store_contents.h"
|
| -#include "chrome/browser/prefs/tracked/pref_hash_store_transaction.h"
|
| +#include "components/user_prefs/tracked/hash_store_contents.h"
|
| +#include "components/user_prefs/tracked/pref_hash_store_transaction.h"
|
|
|
| class PrefHashStoreImpl::PrefHashStoreTransactionImpl
|
| : public PrefHashStoreTransaction {
|
| @@ -63,8 +63,7 @@ class PrefHashStoreImpl::PrefHashStoreTransactionImpl
|
| PrefHashStoreImpl::PrefHashStoreImpl(const std::string& seed,
|
| const std::string& device_id,
|
| bool use_super_mac)
|
| - : pref_hash_calculator_(seed, device_id),
|
| - use_super_mac_(use_super_mac) {
|
| + : pref_hash_calculator_(seed, device_id), use_super_mac_(use_super_mac) {
|
| }
|
|
|
| PrefHashStoreImpl::~PrefHashStoreImpl() {
|
| @@ -101,10 +100,9 @@ PrefHashStoreImpl::PrefHashStoreTransactionImpl::PrefHashStoreTransactionImpl(
|
| if (super_mac.empty())
|
| return;
|
|
|
| - super_mac_valid_ =
|
| - outer_->pref_hash_calculator_.Validate(
|
| - contents()->hash_store_id(), store_contents, super_mac) ==
|
| - PrefHashCalculator::VALID;
|
| + super_mac_valid_ = outer_->pref_hash_calculator_.Validate(
|
| + contents()->hash_store_id(), store_contents,
|
| + super_mac) == PrefHashCalculator::VALID;
|
| }
|
|
|
| PrefHashStoreImpl::PrefHashStoreTransactionImpl::
|
| @@ -195,8 +193,8 @@ PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckSplitValue(
|
| // Keep the common part from the old |keyed_path| and replace the key to
|
| // get the new |keyed_path|.
|
| keyed_path.replace(common_part_length, std::string::npos, it.key());
|
| - switch (outer_->pref_hash_calculator_.Validate(
|
| - keyed_path, &it.value(), entry->second)) {
|
| + switch (outer_->pref_hash_calculator_.Validate(keyed_path, &it.value(),
|
| + entry->second)) {
|
| case PrefHashCalculator::VALID:
|
| break;
|
| case SECURE_LEGACY:
|
| @@ -218,8 +216,7 @@ PrefHashStoreImpl::PrefHashStoreTransactionImpl::CheckSplitValue(
|
| // Anything left in the map is missing from the data.
|
| for (std::map<std::string, std::string>::const_iterator it =
|
| split_macs.begin();
|
| - it != split_macs.end();
|
| - ++it) {
|
| + it != split_macs.end(); ++it) {
|
| invalid_keys->push_back(it->first);
|
| }
|
|
|
| @@ -244,9 +241,9 @@ void PrefHashStoreImpl::PrefHashStoreTransactionImpl::StoreSplitHash(
|
| // Keep the common part from the old |keyed_path| and replace the key to
|
| // get the new |keyed_path|.
|
| keyed_path.replace(common_part_length, std::string::npos, it.key());
|
| - (*mutable_dictionary)->SetString(
|
| - keyed_path,
|
| - outer_->pref_hash_calculator_.Calculate(keyed_path, &it.value()));
|
| + (*mutable_dictionary)
|
| + ->SetString(keyed_path, outer_->pref_hash_calculator_.Calculate(
|
| + keyed_path, &it.value()));
|
| }
|
| }
|
| super_mac_dirty_ = true;
|
|
|