Index: components/user_prefs/tracked/hash_store_contents.h |
diff --git a/components/user_prefs/tracked/hash_store_contents.h b/components/user_prefs/tracked/hash_store_contents.h |
index 91441c8fb91d5f904ece2420e6d8818e38fa9f17..9cc8abba09093e979833ef030a19b20e3195d05d 100644 |
--- a/components/user_prefs/tracked/hash_store_contents.h |
+++ b/components/user_prefs/tracked/hash_store_contents.h |
@@ -26,6 +26,15 @@ class HashStoreContents { |
public: |
virtual ~HashStoreContents() {} |
+ // Returns true if this implementation of HashStoreContents can be copied via |
+ // MakeCopy(). |
+ virtual bool IsCopyable() const = 0; |
+ |
+ // Returns a copy of this HashStoreContents. Must only be called on |
+ // lightweight implementations (which return true from IsCopyable()) and only |
+ // in scenarios where a copy cannot be avoided. |
+ virtual std::unique_ptr<HashStoreContents> MakeCopy() const = 0; |
+ |
// Returns the suffix to be appended to UMA histograms for this store type. |
// The returned value must either be an empty string or one of the values in |
// histograms.xml's TrackedPreferencesExternalValidators. |