summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-16 23:17:01 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-16 23:17:01 +0000
commitbb100cb03f67173a17124527bfd899ff607db361 (patch)
tree3cc962faf99778a8dfc4b0460897dc3b50eff273
parent26abec2256f8e964208db94acbdd8be1cf1c68ed (diff)
downloadchromium_src-bb100cb03f67173a17124527bfd899ff607db361.zip
chromium_src-bb100cb03f67173a17124527bfd899ff607db361.tar.gz
chromium_src-bb100cb03f67173a17124527bfd899ff607db361.tar.bz2
Adds logging of loading/saving bookmarks to help me diagnose why some
folks are having problems. BUG=none TEST=none Review URL: http://codereview.chromium.org/2914 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2290 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/bookmarks/bookmark_model.cc9
-rw-r--r--chrome/browser/bookmarks/bookmark_storage.cc9
-rw-r--r--chrome/browser/history/history.cc1
3 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc
index 7ddae40..af5a43f 100644
--- a/chrome/browser/bookmarks/bookmark_model.cc
+++ b/chrome/browser/bookmarks/bookmark_model.cc
@@ -122,6 +122,8 @@ void BookmarkModel::Load() {
return;
}
+ LOG(INFO) << "Loading bookmarks";
+
// Listen for changes to favicons so that we can update the favicon of the
// node appropriately.
NotificationService::current()->AddObserver(
@@ -394,6 +396,9 @@ void BookmarkModel::OnBookmarkStorageLoadedBookmarks(
return;
}
+ LOG(INFO) << "Loaded bookmarks, file_exists=" << file_exists <<
+ " from_history=" << loaded_from_history;
+
if (file_exists || loaded_from_history || !profile_ ||
!profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)) {
// The file exists, we're loaded.
@@ -418,6 +423,8 @@ void BookmarkModel::OnBookmarkStorageLoadedBookmarks(
profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
if (!history->backend_loaded()) {
// The backend isn't finished loading. Wait for it.
+ LOG(INFO) << " waiting for history to finish";
+
waiting_for_history_load_ = true;
NotificationService::current()->AddObserver(
this, NOTIFY_HISTORY_LOADED, Source<Profile>(profile_));
@@ -432,6 +439,8 @@ void BookmarkModel::OnHistoryDone() {
return;
}
+ LOG(INFO) << " history done, reloading";
+
// If the bookmarks were stored in the db the db will have migrated them to
// a file now. Try loading from the file.
store_->LoadBookmarks(true);
diff --git a/chrome/browser/bookmarks/bookmark_storage.cc b/chrome/browser/bookmarks/bookmark_storage.cc
index b46b092..eb9bbe4 100644
--- a/chrome/browser/bookmarks/bookmark_storage.cc
+++ b/chrome/browser/bookmarks/bookmark_storage.cc
@@ -147,9 +147,18 @@ void BookmarkStorageBackend::Write(Value* value) {
MoveFileEx(tmp_file.c_str(), path_.c_str(),
MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING);
DCHECK(move_result);
+ if (!move_result)
+ LOG(WARNING) << " writing bookmarks failed, result=" << move_result;
+ else
+ LOG(INFO) << "wrote bookmarks, file=" << path_;
+ } else {
+ LOG(INFO) << "wrote bookmarks, file=" << path_;
}
// Nuke the history file so that we don't attempt to load from it again.
file_util::Delete(tmp_history_path_, false);
+ } else {
+ LOG(WARNING) << " writing bookmarks failed, bytes written=" <<
+ bytes_written;
}
}
diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc
index a1adca1..db04446 100644
--- a/chrome/browser/history/history.cc
+++ b/chrome/browser/history/history.cc
@@ -639,6 +639,7 @@ void HistoryService::BroadcastNotifications(
}
void HistoryService::OnDBLoaded() {
+ LOG(INFO) << "History backend finished loading";
backend_loaded_ = true;
NotificationService::current()->Notify(NOTIFY_HISTORY_LOADED,
Source<Profile>(profile_),