diff options
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 2 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_value_store.cc | 8 | ||||
-rw-r--r-- | chrome/common/json_pref_store.cc | 5 | ||||
-rw-r--r-- | chrome/common/pref_store.h | 4 |
4 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 885e390..472464f 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -605,7 +605,7 @@ void BrowserProcessImpl::CreateLocalState() { FilePath local_state_path; PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); local_state_.reset(PrefService::CreatePrefService(local_state_path, NULL)); - } +} void BrowserProcessImpl::CreateIconManager() { DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); diff --git a/chrome/browser/prefs/pref_value_store.cc b/chrome/browser/prefs/pref_value_store.cc index 6ab4b8f..501f1e1 100644 --- a/chrome/browser/prefs/pref_value_store.cc +++ b/chrome/browser/prefs/pref_value_store.cc @@ -23,11 +23,9 @@ PrefValueStore* PrefValueStore::CreatePrefValueStore( JsonPrefStore* user = NULL; ConfigurationPolicyPrefStore* recommended = NULL; - if (!pref_filename.empty()) { - user = new JsonPrefStore( - pref_filename, - ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE)); - } + user = new JsonPrefStore( + pref_filename, + ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE)); if (!user_only) { managed = ConfigurationPolicyPrefStore::CreateManagedPolicyPrefStore(); diff --git a/chrome/common/json_pref_store.cc b/chrome/common/json_pref_store.cc index 9acfcb2d..d68307f 100644 --- a/chrome/common/json_pref_store.cc +++ b/chrome/common/json_pref_store.cc @@ -31,6 +31,10 @@ JsonPrefStore::~JsonPrefStore() { } PrefStore::PrefReadError JsonPrefStore::ReadPrefs() { + if (path_.empty()) { + read_only_ = true; + return PREF_READ_ERROR_FILE_NOT_SPECIFIED; + } JSONFileValueSerializer serializer(path_); int error_code = 0; @@ -127,4 +131,3 @@ bool JsonPrefStore::SerializeData(std::string* output) { scoped_ptr<DictionaryValue> copy(prefs_->DeepCopyWithoutEmptyChildren()); return serializer.Serialize(*(copy.get())); } - diff --git a/chrome/common/pref_store.h b/chrome/common/pref_store.h index d5acd89..727c020 100644 --- a/chrome/common/pref_store.h +++ b/chrome/common/pref_store.h @@ -27,7 +27,8 @@ class PrefStore { PREF_READ_ERROR_FILE_LOCKED, PREF_READ_ERROR_NO_FILE, PREF_READ_ERROR_JSON_REPEAT, - PREF_READ_ERROR_OTHER + PREF_READ_ERROR_OTHER, + PREF_READ_ERROR_FILE_NOT_SPECIFIED }; virtual ~PrefStore() { } @@ -47,4 +48,3 @@ class PrefStore { }; #endif // CHROME_COMMON_PREF_STORE_H_ - |