Index: base/prefs/json_pref_store.h |
diff --git a/base/prefs/json_pref_store.h b/base/prefs/json_pref_store.h |
index 9e6c1821834e712496f6cf481fc501a56bbfab30..95ecfbb56255577bba1856c9937f734f91cecb3d 100644 |
--- a/base/prefs/json_pref_store.h |
+++ b/base/prefs/json_pref_store.h |
@@ -13,6 +13,7 @@ |
#include "base/files/file_path.h" |
#include "base/files/important_file_writer.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/memory/scoped_vector.h" |
#include "base/message_loop/message_loop_proxy.h" |
#include "base/observer_list.h" |
#include "base/prefs/base_prefs_export.h" |
@@ -51,6 +52,10 @@ class BASE_PREFS_EXPORT JsonPrefStore |
virtual bool HasObservers() const OVERRIDE; |
virtual bool IsInitializationComplete() const OVERRIDE; |
+ // Adds an observer that will be automatically deregistered and destroyed by |
+ // ~JsonPrefStore(). |
+ void AddOwnedObserver(scoped_ptr<PrefStore::Observer> observer); |
gab
2013/11/27 23:43:27
#include base/prefs/pref_store.h
for PrefStore::O
robertshield
2013/11/28 02:54:26
AddObserver takes a raw pointer, any reason not to
erikwright (departed)
2013/11/28 17:48:07
Because there is a transfer of ownership.
|
+ |
// PersistentPrefStore overrides: |
virtual bool GetMutableValue(const std::string& key, |
base::Value** result) OVERRIDE; |
@@ -89,6 +94,7 @@ class BASE_PREFS_EXPORT JsonPrefStore |
base::ImportantFileWriter writer_; |
ObserverList<PrefStore::Observer, true> observers_; |
+ ScopedVector<PrefStore::Observer> owned_observers_; |
scoped_ptr<ReadErrorDelegate> error_delegate_; |