From 8b70d0ce73dd36bc0042ba7a6d8c4521c369b9fe Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Thu, 11 Nov 2010 03:45:31 +0000 Subject: Preferences: remove log spam. The common case is for this file to not be available; we don't need to report it as an error each time. I improved this in r59984, but it regressed in r64945. Review URL: http://codereview.chromium.org/4740003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65770 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/installer/util/master_preferences.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'chrome') diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc index b2ae7ef..1602f6d 100644 --- a/chrome/installer/util/master_preferences.cc +++ b/chrome/installer/util/master_preferences.cc @@ -52,10 +52,9 @@ std::vector GetNamedList(const char* name, DictionaryValue* ParseDistributionPreferences( const FilePath& master_prefs_path) { std::string json_data; - if (!file_util::ReadFileToString(master_prefs_path, &json_data)) { - LOG(WARNING) << "Failed to read master prefs file. "; + if (!file_util::ReadFileToString(master_prefs_path, &json_data)) return NULL; - } + JSONStringValueSerializer json(json_data); std::string error; scoped_ptr root(json.Deserialize(NULL, &error)); @@ -134,8 +133,7 @@ MasterPreferences::MasterPreferences(const CommandLine& cmd_line) MasterPreferences::MasterPreferences(const FilePath& prefs_path) : distribution_(NULL), preferences_read_from_file_(false) { master_dictionary_.reset(ParseDistributionPreferences(prefs_path)); - LOG_IF(ERROR, !master_dictionary_.get()) << "Failed to parse " - << prefs_path.value(); + if (!master_dictionary_.get()) { master_dictionary_.reset(new DictionaryValue()); } else { -- cgit v1.1