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

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

Issue 2692203007: Add PrefStore::GetValues (Closed)
Patch Set: Address review comments Created 3 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/overlay_user_pref_store.cc ('k') | components/prefs/pref_value_map.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_STORE_H_ 5 #ifndef COMPONENTS_PREFS_PREF_STORE_H_
6 #define COMPONENTS_PREFS_PREF_STORE_H_ 6 #define COMPONENTS_PREFS_PREF_STORE_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "components/prefs/base_prefs_export.h" 13 #include "components/prefs/base_prefs_export.h"
13 14
14 namespace base { 15 namespace base {
16 class DictionaryValue;
15 class Value; 17 class Value;
16 } 18 }
17 19
18 // This is an abstract interface for reading and writing from/to a persistent 20 // This is an abstract interface for reading and writing from/to a persistent
19 // preference store, used by PrefService. An implementation using a JSON file 21 // preference store, used by PrefService. An implementation using a JSON file
20 // can be found in JsonPrefStore, while an implementation without any backing 22 // can be found in JsonPrefStore, while an implementation without any backing
21 // store for testing can be found in TestingPrefStore. Furthermore, there is 23 // store for testing can be found in TestingPrefStore. Furthermore, there is
22 // CommandLinePrefStore, which bridges command line options to preferences and 24 // CommandLinePrefStore, which bridges command line options to preferences and
23 // ConfigurationPolicyPrefStore, which is used for hooking up configuration 25 // ConfigurationPolicyPrefStore, which is used for hooking up configuration
24 // policy with the preference subsystem. 26 // policy with the preference subsystem.
(...skipping 20 matching lines...) Expand all
45 47
46 // Whether the store has completed all asynchronous initialization. 48 // Whether the store has completed all asynchronous initialization.
47 virtual bool IsInitializationComplete() const; 49 virtual bool IsInitializationComplete() const;
48 50
49 // Get the value for a given preference |key| and stores it in |*result|. 51 // Get the value for a given preference |key| and stores it in |*result|.
50 // |*result| is only modified if the return value is true and if |result| 52 // |*result| is only modified if the return value is true and if |result|
51 // is not NULL. Ownership of the |*result| value remains with the PrefStore. 53 // is not NULL. Ownership of the |*result| value remains with the PrefStore.
52 virtual bool GetValue(const std::string& key, 54 virtual bool GetValue(const std::string& key,
53 const base::Value** result) const = 0; 55 const base::Value** result) const = 0;
54 56
57 // Get all the values.
Sam McNally 2017/02/20 00:31:11 Document whether this can return null.
tibell 2017/02/20 03:05:09 Done.
58 virtual std::unique_ptr<base::DictionaryValue> GetValues() const = 0;
59
55 protected: 60 protected:
56 friend class base::RefCounted<PrefStore>; 61 friend class base::RefCounted<PrefStore>;
57 virtual ~PrefStore() {} 62 virtual ~PrefStore() {}
58 63
59 private: 64 private:
60 DISALLOW_COPY_AND_ASSIGN(PrefStore); 65 DISALLOW_COPY_AND_ASSIGN(PrefStore);
61 }; 66 };
62 67
63 #endif // COMPONENTS_PREFS_PREF_STORE_H_ 68 #endif // COMPONENTS_PREFS_PREF_STORE_H_
OLDNEW
« no previous file with comments | « components/prefs/overlay_user_pref_store.cc ('k') | components/prefs/pref_value_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698