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

Unified Diff: trunk/src/chrome/browser/prefs/tracked/segregated_pref_store.h

Issue 273243002: Revert 269415 "Introduce a new framework for back-and-forth trac..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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
Index: trunk/src/chrome/browser/prefs/tracked/segregated_pref_store.h
===================================================================
--- trunk/src/chrome/browser/prefs/tracked/segregated_pref_store.h (revision 269437)
+++ trunk/src/chrome/browser/prefs/tracked/segregated_pref_store.h (working copy)
@@ -6,8 +6,8 @@
#define CHROME_BROWSER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_
#include <set>
-#include <string>
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -41,7 +41,8 @@
SegregatedPrefStore(
const scoped_refptr<PersistentPrefStore>& default_pref_store,
const scoped_refptr<PersistentPrefStore>& selected_pref_store,
- const std::set<std::string>& selected_pref_names);
+ const std::set<std::string>& selected_pref_names,
+ const base::Closure& on_initialization);
// PrefStore implementation
virtual void AddObserver(Observer* observer) OVERRIDE;
@@ -88,14 +89,20 @@
virtual ~SegregatedPrefStore();
- // Returns |selected_pref_store| if |key| is selected and |default_pref_store|
- // otherwise.
- PersistentPrefStore* StoreForKey(const std::string& key);
+ // Returns |selected_pref_store| if |key| is selected or a value is present
+ // in |selected_pref_store|. This could happen if |key| was previously
+ // selected.
const PersistentPrefStore* StoreForKey(const std::string& key) const;
+ // Returns |selected_pref_store| if |key| is selected. If |key| is
+ // unselected but has a value in |selected_pref_store|, moves the value to
+ // |default_pref_store| before returning |default_pref_store|.
+ PersistentPrefStore* StoreForKey(const std::string& key);
+
scoped_refptr<PersistentPrefStore> default_pref_store_;
scoped_refptr<PersistentPrefStore> selected_pref_store_;
std::set<std::string> selected_preference_names_;
+ base::Closure on_initialization_;
scoped_ptr<PersistentPrefStore::ReadErrorDelegate> read_error_delegate_;
ObserverList<PrefStore::Observer, true> observers_;

Powered by Google App Engine
This is Rietveld 408576698