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

Unified Diff: components/user_prefs/tracked/registry_hash_store_contents_win.cc

Issue 2204943002: Integrate registry_hash_store_contents with the rest of tracked prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and added important_file_writer CL as dependent patchset Created 4 years, 3 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
Index: components/user_prefs/tracked/registry_hash_store_contents_win.cc
diff --git a/components/user_prefs/tracked/registry_hash_store_contents_win.cc b/components/user_prefs/tracked/registry_hash_store_contents_win.cc
index cdeb794cb7cac24a2ace7eed6b809439efa781e5..cfced697fad69bc6004b5b00de869be39d8f98ee 100644
--- a/components/user_prefs/tracked/registry_hash_store_contents_win.cc
+++ b/components/user_prefs/tracked/registry_hash_store_contents_win.cc
@@ -19,7 +19,7 @@ using base::win::RegistryValueIterator;
namespace {
-constexpr size_t kMacSize = 32;
+constexpr size_t kMacSize = 64;
base::string16 GetSplitPrefKeyName(const base::string16& reg_key_name,
const std::string& split_key_name) {
@@ -72,6 +72,20 @@ RegistryHashStoreContentsWin::RegistryHashStoreContentsWin(
const base::string16& store_key)
: preference_key_name_(registry_path + L"\\PreferenceMACs\\" + store_key) {}
+RegistryHashStoreContentsWin::RegistryHashStoreContentsWin(
+ const base::string16& preference_key_name)
+ : preference_key_name_(preference_key_name) {}
+
+bool RegistryHashStoreContentsWin::IsCopyable() const {
+ return true;
+}
+
+std::unique_ptr<HashStoreContents> RegistryHashStoreContentsWin::MakeCopy()
+ const {
+ return std::unique_ptr<HashStoreContents>(
+ new RegistryHashStoreContentsWin(preference_key_name_));
gab 2016/09/16 19:47:33 return base::MakeUnique<RegistryHashStoreContentsW
proberge 2016/09/20 21:35:45 Done, but getting compiler errors on this line rel
gab 2016/09/21 17:55:30 Ah indeed because MakeUnique needs access to the c
proberge 2016/09/21 21:09:24 Done.
+}
+
base::StringPiece RegistryHashStoreContentsWin::GetUMASuffix() const {
return user_prefs::tracked::kTrackedPrefRegistryValidationSuffix;
}
@@ -141,7 +155,6 @@ void RegistryHashStoreContentsWin::SetSplitMac(const std::string& path,
}
bool RegistryHashStoreContentsWin::RemoveEntry(const std::string& path) {
- // ClearSplitMac is first to avoid short-circuit issues.
return ClearAtomicMac(preference_key_name_, path) ||
ClearSplitMac(preference_key_name_, path);
}
@@ -149,22 +162,22 @@ bool RegistryHashStoreContentsWin::RemoveEntry(const std::string& path) {
void RegistryHashStoreContentsWin::ImportEntry(const std::string& path,
const base::Value* in_value) {
NOTREACHED()
- << "RegistryHashStore does not support the ImportEntry operation";
+ << "RegistryHashStoreContents does not support the ImportEntry operation";
}
const base::DictionaryValue* RegistryHashStoreContentsWin::GetContents() const {
NOTREACHED()
- << "RegistryHashStore does not support the GetContents operation";
+ << "RegistryHashStoreContents does not support the GetContents operation";
return NULL;
}
std::string RegistryHashStoreContentsWin::GetSuperMac() const {
NOTREACHED()
- << "RegistryHashStore does not support the GetSuperMac operation";
+ << "RegistryHashStoreContents does not support the GetSuperMac operation";
return NULL;
}
void RegistryHashStoreContentsWin::SetSuperMac(const std::string& super_mac) {
NOTREACHED()
- << "RegistryHashStore does not support the SetSuperMac operation";
+ << "RegistryHashStoreContents does not support the SetSuperMac operation";
}

Powered by Google App Engine
This is Rietveld 408576698