Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8935)

Unified Diff: chrome/browser/prefs/pref_hash_store_impl.cc

Issue 332473002: Make super MAC optional. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a unit test. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/pref_hash_store_impl.h ('k') | chrome/browser/prefs/pref_hash_store_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « chrome/browser/prefs/pref_hash_store_impl.h ('k') | chrome/browser/prefs/pref_hash_store_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698