summaryrefslogtreecommitdiffstats
path: root/chrome/browser/pref_service.cc
diff options
context:
space:
mode:
authorerikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 20:25:54 +0000
committererikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 20:25:54 +0000
commitb47d5024a1fcfee3fad78a660adf454775a5ae7a (patch)
tree75dcf6675d77dafb9cf4519ca79adc801ece4c3f /chrome/browser/pref_service.cc
parent4b738f399ad3cdeee808531e18ccf2b44dea85d3 (diff)
downloadchromium_src-b47d5024a1fcfee3fad78a660adf454775a5ae7a.zip
chromium_src-b47d5024a1fcfee3fad78a660adf454775a5ae7a.tar.gz
chromium_src-b47d5024a1fcfee3fad78a660adf454775a5ae7a.tar.bz2
quiet noisy preferences log during unit tests
(also fixes a lint error) BUG=40577 TEST=none Review URL: http://codereview.chromium.org/1600011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/pref_service.cc')
-rw-r--r--chrome/browser/pref_service.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/pref_service.cc b/chrome/browser/pref_service.cc
index 65f1afc..060e462 100644
--- a/chrome/browser/pref_service.cc
+++ b/chrome/browser/pref_service.cc
@@ -120,7 +120,7 @@ void PrefService::InitFromDisk() {
// TODO(erikkay) maybe we should just move it aside and continue.
read_only_ = true;
message_id = IDS_PREFERENCES_CORRUPT_ERROR;
- } if (error == PREF_READ_ERROR_NO_FILE) {
+ } else if (error == PREF_READ_ERROR_NO_FILE) {
// If the file just doesn't exist, maybe this is first run. In any case
// there's no harm in writing out default prefs in this case.
} else {
@@ -150,8 +150,13 @@ PrefService::PrefReadError PrefService::LoadPersistentPrefs() {
std::string error_msg;
scoped_ptr<Value> root(serializer.Deserialize(&error_code, &error_msg));
if (!root.get()) {
+#if defined(GOOGLE_CHROME_BUILD)
+ // This log could be used for more detailed client-side error diagnosis,
+ // but since this triggers often with unit tests, we need to disable it
+ // in non-official builds.
PLOG(ERROR) << "Error reading Preferences: " << error_msg << " " <<
writer_.path().value();
+#endif
PrefReadError pref_error;
switch (error_code) {
case JSONFileValueSerializer::JSON_ACCESS_DENIED: