Index: base/prefs/pref_value_map.h |
diff --git a/base/prefs/pref_value_map.h b/base/prefs/pref_value_map.h |
index 12b30c6973948a54260dce8c0f04db9bd0ad1e7e..7d43f2b96ca1c811cb2f961951765174bd0b29be 100644 |
--- a/base/prefs/pref_value_map.h |
+++ b/base/prefs/pref_value_map.h |
@@ -9,7 +9,8 @@ |
#include <vector> |
#include "base/basictypes.h" |
-#include "base/containers/hash_tables.h" |
+#include "base/containers/scoped_ptr_hash_map.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/prefs/base_prefs_export.h" |
namespace base { |
@@ -19,7 +20,7 @@ class Value; |
// A generic string to value map used by the PrefStore implementations. |
class BASE_PREFS_EXPORT PrefValueMap { |
public: |
- using Map = base::hash_map<std::string, base::Value*>; |
+ using Map = base::ScopedPtrHashMap<std::string, scoped_ptr<base::Value>>; |
using iterator = Map::iterator; |
using const_iterator = Map::const_iterator; |
@@ -32,9 +33,9 @@ class BASE_PREFS_EXPORT PrefValueMap { |
bool GetValue(const std::string& key, const base::Value** value) const; |
bool GetValue(const std::string& key, base::Value** value); |
- // Sets a new |value| for |key|. Takes ownership of |value|, which must be |
- // non-NULL. Returns true if the value changed. |
- bool SetValue(const std::string& key, base::Value* value); |
+ // Sets a new |value| for |key|. |value| must be non-null. Returns true if the |
+ // value changed. |
+ bool SetValue(const std::string& key, scoped_ptr<base::Value> value); |
// Removes the value for |key| from the map. Returns true if a value was |
// removed. |