OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_CHROME_BROWSER_BROWSER_STATE_BROWSER_STATE_INFO_CACHE_H_ | 5 #ifndef IOS_CHROME_BROWSER_BROWSER_STATE_BROWSER_STATE_INFO_CACHE_H_ |
6 #define IOS_CHROME_BROWSER_BROWSER_STATE_BROWSER_STATE_INFO_CACHE_H_ | 6 #define IOS_CHROME_BROWSER_BROWSER_STATE_BROWSER_STATE_INFO_CACHE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 bool BrowserStateIsAuthErrorAtIndex(size_t index) const; | 57 bool BrowserStateIsAuthErrorAtIndex(size_t index) const; |
58 | 58 |
59 const base::FilePath& GetUserDataDir() const; | 59 const base::FilePath& GetUserDataDir() const; |
60 | 60 |
61 // Register cache related preferences in Local State. | 61 // Register cache related preferences in Local State. |
62 static void RegisterPrefs(PrefRegistrySimple* registry); | 62 static void RegisterPrefs(PrefRegistrySimple* registry); |
63 | 63 |
64 private: | 64 private: |
65 const base::DictionaryValue* GetInfoForBrowserStateAtIndex( | 65 const base::DictionaryValue* GetInfoForBrowserStateAtIndex( |
66 size_t index) const; | 66 size_t index) const; |
67 // Saves the browser state info to a cache and takes ownership of |info|. | 67 // Saves the browser state info to a cache. |
68 void SetInfoForBrowserStateAtIndex(size_t index, base::DictionaryValue* info); | 68 void SetInfoForBrowserStateAtIndex( |
| 69 size_t index, |
| 70 std::unique_ptr<base::DictionaryValue> info); |
69 | 71 |
70 std::string CacheKeyFromBrowserStatePath( | 72 std::string CacheKeyFromBrowserStatePath( |
71 const base::FilePath& browser_state_path) const; | 73 const base::FilePath& browser_state_path) const; |
72 void AddBrowserStateCacheKey(const std::string& key); | 74 void AddBrowserStateCacheKey(const std::string& key); |
73 | 75 |
74 PrefService* prefs_; | 76 PrefService* prefs_; |
75 std::vector<std::string> sorted_keys_; | 77 std::vector<std::string> sorted_keys_; |
76 base::FilePath user_data_dir_; | 78 base::FilePath user_data_dir_; |
77 base::ObserverList<BrowserStateInfoCacheObserver, true> observer_list_; | 79 base::ObserverList<BrowserStateInfoCacheObserver, true> observer_list_; |
78 | 80 |
79 DISALLOW_COPY_AND_ASSIGN(BrowserStateInfoCache); | 81 DISALLOW_COPY_AND_ASSIGN(BrowserStateInfoCache); |
80 }; | 82 }; |
81 | 83 |
82 #endif // IOS_CHROME_BROWSER_BROWSER_STATE_BROWSER_STATE_INFO_CACHE_H_ | 84 #endif // IOS_CHROME_BROWSER_BROWSER_STATE_BROWSER_STATE_INFO_CACHE_H_ |
OLD | NEW |