| Index: chrome/browser/prefs/pref_service.h
|
| diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h
|
| index 94dc0f077caa1b6be042674be5d5472864f12f6b..e3237711e4e946cd9762865919a4e3aae700c466 100644
|
| --- a/chrome/browser/prefs/pref_service.h
|
| +++ b/chrome/browser/prefs/pref_service.h
|
| @@ -183,6 +183,9 @@ class PrefService : public PrefServiceBase, public base::NonThreadSafe {
|
| virtual void RegisterStringPref(const char* path,
|
| const std::string& default_value,
|
| PrefSyncStatus sync_status) OVERRIDE;
|
| + virtual void RegisterStringPrefIfNew(const char* path,
|
| + const std::string& default_value,
|
| + PrefSyncStatus sync_status) OVERRIDE;
|
| virtual void RegisterFilePathPref(const char* path,
|
| const FilePath& default_value,
|
| PrefSyncStatus sync_status) OVERRIDE;
|
| @@ -310,12 +313,31 @@ class PrefService : public PrefServiceBase, public base::NonThreadSafe {
|
|
|
| // Registers a new preference at |path|. The |default_value| must not be
|
| // NULL as it determines the preference value's type.
|
| + // This will only be called once we have checked that the preference is new.
|
| + // RegisterNewPreference must not be called twice for the same path.
|
| + // This method takes ownership of |default_value|.
|
| + void RegisterNewPreference(const char* path,
|
| + Value* default_value,
|
| + PrefSyncStatus sync_status);
|
| +
|
| + // Registers a new preference at |path|. The |default_value| must not be
|
| + // NULL as it determines the preference value's type.
|
| // RegisterPreference must not be called twice for the same path.
|
| // This method takes ownership of |default_value|.
|
| void RegisterPreference(const char* path,
|
| base::Value* default_value,
|
| PrefSyncStatus sync_status);
|
|
|
| + // Registers a preference at |path|. The |default_value| must not be
|
| + // NULL as it determines the preference value's type.
|
| + // This does nothing if the preference is already registered.
|
| + // This method takes ownership of |default_value|.
|
| + // Introduced to improve performance by avoiding the need for a check before
|
| + // calling RegisterPreference.
|
| + void RegisterPreferenceIfNew(const char* path,
|
| + base::Value* default_value,
|
| + PrefSyncStatus sync_status);
|
| +
|
| // Sets the value for this pref path in the user pref store and informs the
|
| // PrefNotifier of the change.
|
| void SetUserPrefValue(const char* path, base::Value* new_value);
|
|
|