diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-14 19:22:29 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-14 19:22:29 +0000 |
commit | a78e948d0165924e55d35f3c8a01e3b387df4d6e (patch) | |
tree | 8801ee7a17626a6598ae16b130f0136b84f137b1 /chrome/common | |
parent | 3cfade1e6853ab12c5c13c4d783717df32fce5a4 (diff) | |
download | chromium_src-a78e948d0165924e55d35f3c8a01e3b387df4d6e.zip chromium_src-a78e948d0165924e55d35f3c8a01e3b387df4d6e.tar.gz chromium_src-a78e948d0165924e55d35f3c8a01e3b387df4d6e.tar.bz2 |
Fixed regression: various preferences were not persisted when changed from incognito window
This CL renames the OverlayPrefStore to an IncognitoPrefStore. This IncognitoPrefStore stores write operations in memory and prevents persisting them to the user prefs file. The CL also blacklists two preferences from being stored in the in-memory IncognitoPrefStore to fix the regressions mentioned in the bugs.
BUG=87191,84472
TEST=see bug descriptions
Review URL: http://codereview.chromium.org/7342043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/json_pref_store.cc | 3 | ||||
-rw-r--r-- | chrome/common/pref_names.cc | 6 | ||||
-rw-r--r-- | chrome/common/pref_store.h | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/chrome/common/json_pref_store.cc b/chrome/common/json_pref_store.cc index 5891633..5dd3cf2 100644 --- a/chrome/common/json_pref_store.cc +++ b/chrome/common/json_pref_store.cc @@ -155,7 +155,8 @@ PrefStore::ReadResult JsonPrefStore::GetValue(const std::string& key, const Value** result) const { Value* tmp = NULL; if (prefs_->Get(key, &tmp)) { - *result = tmp; + if (result) + *result = tmp; return READ_OK; } return READ_NO_VALUE; diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index a0a3378..a7be7a3 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -1327,11 +1327,11 @@ const char kCloudPrintEnableJobPoll[] = "cloud_print.enable_job_poll"; const char kCloudPrintRobotRefreshToken[] = "cloud_print.robot_refresh_token"; const char kCloudPrintRobotEmail[] = "cloud_print.robot_email"; -// Preference to story proxy settings. +// Preference to store proxy settings. const char kProxy[] = "proxy"; const char kMaxConnectionsPerProxy[] = "net.max_connections_per_proxy"; -// Preferences that are exclusivly used to store managed values for default +// Preferences that are exclusively used to store managed values for default // content settings. const char kManagedDefaultCookiesSetting[] = "profile.managed_default_content_settings.cookies"; @@ -1344,7 +1344,7 @@ const char kManagedDefaultPluginsSetting[] = const char kManagedDefaultPopupsSetting[] = "profile.managed_default_content_settings.popups"; -// Preferences that are exclusivly used to store managed +// Preferences that are exclusively used to store managed // content settings patterns. const char kManagedCookiesAllowedForUrls[] = "profile.managed_cookies_allowed_for_urls"; diff --git a/chrome/common/pref_store.h b/chrome/common/pref_store.h index bc74af1..5e8b2c5 100644 --- a/chrome/common/pref_store.h +++ b/chrome/common/pref_store.h @@ -54,9 +54,9 @@ class PrefStore : public base::RefCounted<PrefStore> { // Whether the store has completed all asynchronous initialization. virtual bool IsInitializationComplete() const; - // Get the value for a given preference |key| and stores it in |result|. - // |result| is only modified if the return value is READ_OK. Ownership of the - // |result| value remains with the PrefStore. + // Get the value for a given preference |key| and stores it in |*result|. + // |*result| is only modified if the return value is READ_OK and if |result| + // is not NULL. Ownership of the |*result| value remains with the PrefStore. virtual ReadResult GetValue(const std::string& key, const base::Value** result) const = 0; |