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

Unified Diff: base/prefs/pref_value_map.h

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 | « base/prefs/pref_service_unittest.cc ('k') | base/prefs/pref_value_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « base/prefs/pref_service_unittest.cc ('k') | base/prefs/pref_value_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698