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

Side by Side Diff: components/user_prefs/tracked/dictionary_hash_store_contents.h

Issue 2204943002: Integrate registry_hash_store_contents with the rest of tracked prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply comments from patch set 27 Created 4 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ 5 #ifndef COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_
6 #define COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ 6 #define COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/user_prefs/tracked/hash_store_contents.h" 9 #include "components/user_prefs/tracked/hash_store_contents.h"
10 10
(...skipping 13 matching lines...) Expand all
24 class DictionaryHashStoreContents : public HashStoreContents { 24 class DictionaryHashStoreContents : public HashStoreContents {
25 public: 25 public:
26 // Constructs a DictionaryHashStoreContents that reads from and writes to 26 // Constructs a DictionaryHashStoreContents that reads from and writes to
27 // |storage|. 27 // |storage|.
28 explicit DictionaryHashStoreContents(base::DictionaryValue* storage); 28 explicit DictionaryHashStoreContents(base::DictionaryValue* storage);
29 29
30 // Registers required preferences. 30 // Registers required preferences.
31 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 31 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
32 32
33 // HashStoreContents implementation 33 // HashStoreContents implementation
34 bool IsCopyable() const override;
35 std::unique_ptr<HashStoreContents> MakeCopy() const override;
34 base::StringPiece GetUMASuffix() const override; 36 base::StringPiece GetUMASuffix() const override;
35 void Reset() override; 37 void Reset() override;
36 bool GetMac(const std::string& path, std::string* out_value) override; 38 bool GetMac(const std::string& path, std::string* out_value) override;
37 bool GetSplitMacs(const std::string& path, 39 bool GetSplitMacs(const std::string& path,
38 std::map<std::string, std::string>* split_macs) override; 40 std::map<std::string, std::string>* split_macs) override;
39 void SetMac(const std::string& path, const std::string& value) override; 41 void SetMac(const std::string& path, const std::string& value) override;
40 void SetSplitMac(const std::string& path, 42 void SetSplitMac(const std::string& path,
41 const std::string& split_path, 43 const std::string& split_path,
42 const std::string& value) override; 44 const std::string& value) override;
43 void ImportEntry(const std::string& path, 45 void ImportEntry(const std::string& path,
44 const base::Value* in_value) override; 46 const base::Value* in_value) override;
45 bool RemoveEntry(const std::string& path) override; 47 bool RemoveEntry(const std::string& path) override;
46 const base::DictionaryValue* GetContents() const override; 48 const base::DictionaryValue* GetContents() const override;
47 std::string GetSuperMac() const override; 49 std::string GetSuperMac() const override;
48 void SetSuperMac(const std::string& super_mac) override; 50 void SetSuperMac(const std::string& super_mac) override;
49 51
50 private: 52 private:
51 base::DictionaryValue* storage_; 53 base::DictionaryValue* storage_;
52 54
53 // Helper function to get a mutable version of the macs from |storage_|, 55 // Helper function to get a mutable version of the macs from |storage_|,
54 // creating it if needed and |create_if_null| is true. 56 // creating it if needed and |create_if_null| is true.
55 base::DictionaryValue* GetMutableContents(bool create_if_null); 57 base::DictionaryValue* GetMutableContents(bool create_if_null);
56 58
57 DISALLOW_COPY_AND_ASSIGN(DictionaryHashStoreContents); 59 DISALLOW_COPY_AND_ASSIGN(DictionaryHashStoreContents);
58 }; 60 };
59 61
60 #endif // COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_ 62 #endif // COMPONENTS_USER_PREFS_TRACKED_DICTIONARY_HASH_STORE_CONTENTS_H_
OLDNEW
« no previous file with comments | « components/prefs/json_pref_store.cc ('k') | components/user_prefs/tracked/dictionary_hash_store_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698