| Index: chrome/browser/prefs/pref_hash_store_impl.cc
|
| diff --git a/chrome/browser/prefs/pref_hash_store_impl.cc b/chrome/browser/prefs/pref_hash_store_impl.cc
|
| index a82d449f4e40ff4618ca6c998a3c563ffafd56d5..4f6f6d6754beddc52616934a6156f4cf9dd425fb 100644
|
| --- a/chrome/browser/prefs/pref_hash_store_impl.cc
|
| +++ b/chrome/browser/prefs/pref_hash_store_impl.cc
|
| @@ -59,11 +59,15 @@ class PrefHashStoreImpl::PrefHashStoreTransactionImpl
|
|
|
| PrefHashStoreImpl::PrefHashStoreImpl(const std::string& seed,
|
| const std::string& device_id,
|
| - scoped_ptr<HashStoreContents> contents)
|
| + scoped_ptr<HashStoreContents> contents,
|
| + bool use_super_mac)
|
| : pref_hash_calculator_(seed, device_id),
|
| contents_(contents.Pass()),
|
| initial_hashes_dictionary_trusted_(
|
| - IsHashDictionaryTrusted(pref_hash_calculator_, *contents_)),
|
| + use_super_mac
|
| + ? IsHashDictionaryTrusted(pref_hash_calculator_, *contents_)
|
| + : false),
|
| + use_super_mac_(use_super_mac),
|
| has_pending_write_(false) {
|
| DCHECK(contents_);
|
| UMA_HISTOGRAM_BOOLEAN("Settings.HashesDictionaryTrusted",
|
| @@ -97,11 +101,13 @@ PrefHashStoreImpl::PrefHashStoreTransactionImpl::
|
| // Update the super MAC if and only if the hashes dictionary has been
|
| // modified in this transaction.
|
| if (has_changed_) {
|
| - // Get the dictionary of hashes (or NULL if it doesn't exist).
|
| - const base::DictionaryValue* hashes_dict = outer_->contents_->GetContents();
|
| - outer_->contents_->SetSuperMac(outer_->pref_hash_calculator_.Calculate(
|
| - outer_->contents_->hash_store_id(), hashes_dict));
|
| -
|
| + if (outer_->use_super_mac_) {
|
| + // Get the dictionary of hashes (or NULL if it doesn't exist).
|
| + const base::DictionaryValue* hashes_dict =
|
| + outer_->contents_->GetContents();
|
| + outer_->contents_->SetSuperMac(outer_->pref_hash_calculator_.Calculate(
|
| + outer_->contents_->hash_store_id(), hashes_dict));
|
| + }
|
| outer_->has_pending_write_ = true;
|
| }
|
|
|
|
|