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

Side by Side Diff: components/prefs/pref_value_map.h

Issue 1662843002: Revert of Delete base/prefs and update callers to use components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « components/prefs/pref_store_observer_mock.h ('k') | components/prefs/pref_value_store.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PREFS_PREF_VALUE_MAP_H_ 5 #ifndef BASE_PREFS_PREF_VALUE_MAP_H_
6 #define COMPONENTS_PREFS_PREF_VALUE_MAP_H_ 6 #define BASE_PREFS_PREF_VALUE_MAP_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/containers/scoped_ptr_hash_map.h" 11 #include "base/containers/scoped_ptr_hash_map.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "components/prefs/base_prefs_export.h" 14 #include "components/prefs/base_prefs_export.h"
15 15
16 namespace base { 16 namespace base {
17 class Value; 17 class Value;
18 } 18 }
19 19
20 // A generic string to value map used by the PrefStore implementations. 20 // A generic string to value map used by the PrefStore implementations.
21 class COMPONENTS_PREFS_EXPORT PrefValueMap { 21 class BASE_PREFS_EXPORT PrefValueMap {
22 public: 22 public:
23 using Map = base::ScopedPtrHashMap<std::string, scoped_ptr<base::Value>>; 23 using Map = base::ScopedPtrHashMap<std::string, scoped_ptr<base::Value>>;
24 using iterator = Map::iterator; 24 using iterator = Map::iterator;
25 using const_iterator = Map::const_iterator; 25 using const_iterator = Map::const_iterator;
26 26
27 PrefValueMap(); 27 PrefValueMap();
28 virtual ~PrefValueMap(); 28 virtual ~PrefValueMap();
29 29
30 // Gets the value for |key| and stores it in |value|. Ownership remains with 30 // Gets the value for |key| and stores it in |value|. Ownership remains with
31 // the map. Returns true if a value is present. If not, |value| is not 31 // the map. Returns true if a value is present. If not, |value| is not
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // only in one of the maps. 81 // only in one of the maps.
82 void GetDifferingKeys(const PrefValueMap* other, 82 void GetDifferingKeys(const PrefValueMap* other,
83 std::vector<std::string>* differing_keys) const; 83 std::vector<std::string>* differing_keys) const;
84 84
85 private: 85 private:
86 Map prefs_; 86 Map prefs_;
87 87
88 DISALLOW_COPY_AND_ASSIGN(PrefValueMap); 88 DISALLOW_COPY_AND_ASSIGN(PrefValueMap);
89 }; 89 };
90 90
91 #endif // COMPONENTS_PREFS_PREF_VALUE_MAP_H_ 91 #endif // BASE_PREFS_PREF_VALUE_MAP_H_
OLDNEW
« no previous file with comments | « components/prefs/pref_store_observer_mock.h ('k') | components/prefs/pref_value_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698