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

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

Issue 2937633003: Revert of Fix a race condition in ~RegistryHashStoreContentsWin (Closed)
Patch Set: Created 3 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 | « no previous file | services/preferences/tracked/registry_hash_store_contents_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/preferences/tracked/registry_hash_store_contents_win.h
diff --git a/services/preferences/tracked/registry_hash_store_contents_win.h b/services/preferences/tracked/registry_hash_store_contents_win.h
index dd55669815790eabf4ab017c4e4b5f1280726c3d..0b3b396205d60cda624442ace27e58a48357ce79 100644
--- a/services/preferences/tracked/registry_hash_store_contents_win.h
+++ b/services/preferences/tracked/registry_hash_store_contents_win.h
@@ -8,29 +8,18 @@
#include "base/macros.h"
#include "base/strings/string16.h"
#include "services/preferences/tracked/hash_store_contents.h"
-#include "services/preferences/tracked/temp_scoped_dir_cleaner.h"
-
-// Helper object to clear registry entries for scoped temporary pref stores.
-class TempScopedDirRegistryCleaner : public TempScopedDirCleaner {
- public:
- void SetRegistryPath(const base::string16& registry_path);
-
- private:
- friend class base::RefCountedThreadSafe<TempScopedDirRegistryCleaner>;
- ~TempScopedDirRegistryCleaner() override;
-
- base::string16 registry_path_;
-};
// Implements HashStoreContents by storing MACs in the Windows registry.
class RegistryHashStoreContentsWin : public HashStoreContents {
public:
// Constructs a RegistryHashStoreContents which acts on a registry entry
- // defined by |registry_path| and |store_key|.
- explicit RegistryHashStoreContentsWin(
- const base::string16& registry_path,
- const base::string16& store_key,
- scoped_refptr<TempScopedDirCleaner> temp_dir_cleaner);
+ // defined by |registry_path| and |store_key|. If |store_key| begins with
+ // base::ScopedTempDir::GetTempDirPrefix(), this RegistryHashStoreContentsWin
+ // will self Reset() on destruction to avoid proliferating keys in tests that
+ // create a profile in a ScopedTempDir (https://crbug.com/721245).
+ explicit RegistryHashStoreContentsWin(const base::string16& registry_path,
+ const base::string16& store_key);
+
~RegistryHashStoreContentsWin() override;
// HashStoreContents overrides:
@@ -60,7 +49,7 @@
const RegistryHashStoreContentsWin& other);
const base::string16 preference_key_name_;
- scoped_refptr<TempScopedDirCleaner> temp_dir_cleaner_;
+ const bool reset_on_delete_;
};
#endif // SERVICES_PREFERENCES_TRACKED_REGISTRY_HASH_STORE_CONTENTS_WIN_H_
« no previous file with comments | « no previous file | services/preferences/tracked/registry_hash_store_contents_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698