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

Unified Diff: services/preferences/tracked/registry_hash_store_contents_win.cc

Issue 2893703002: Cleanup PreferenceMACs on browser_tests startup (Closed)
Patch Set: re-enable PrefHashBrowserTests disabled for this issue Created 3 years, 7 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: services/preferences/tracked/registry_hash_store_contents_win.cc
diff --git a/services/preferences/tracked/registry_hash_store_contents_win.cc b/services/preferences/tracked/registry_hash_store_contents_win.cc
index ab1c2c5647857bd219a9ceb8ac3a89e727239a0f..69b79493cb67efa6b3c1f4f18dec64541fd01b61 100644
--- a/services/preferences/tracked/registry_hash_store_contents_win.cc
+++ b/services/preferences/tracked/registry_hash_store_contents_win.cc
@@ -10,6 +10,7 @@
#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_split.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@@ -71,7 +72,16 @@ bool ClearSplitMac(const base::string16& reg_key_name,
RegistryHashStoreContentsWin::RegistryHashStoreContentsWin(
const base::string16& registry_path,
const base::string16& store_key)
- : preference_key_name_(registry_path + L"\\PreferenceMACs\\" + store_key) {}
+ : preference_key_name_(registry_path + L"\\PreferenceMACs\\" + store_key),
+ reset_on_delete_(base::StartsWith(store_key,
jam 2017/05/17 19:06:16 I'm curious, it seems this cleanup code is quite f
gab 2017/05/17 20:01:05 I debated this too... basically the problem is a t
grt (UTC plus 2) 2017/05/18 08:21:58 My suggestion on the bug was to create a ScopedPro
+ L"scoped_dir",
+ base::CompareCase::INSENSITIVE_ASCII)) {
+}
+
+RegistryHashStoreContentsWin::~RegistryHashStoreContentsWin() {
+ if (reset_on_delete_)
+ Reset();
+}
RegistryHashStoreContentsWin::RegistryHashStoreContentsWin(
const RegistryHashStoreContentsWin& other) = default;

Powered by Google App Engine
This is Rietveld 408576698