From afecfb73fdbca719e3a861b3255e68f2c3ef8780 Mon Sep 17 00:00:00 2001 From: "msarda@chromium.org" Date: Thu, 18 Apr 2013 17:17:33 +0000 Subject: Delay bookmarks load while the profile is loading. This CL adds a new DeferredSequencedtaskRunner that queues up tasks until a first call to Start is issued. It creates such a task runner for the execution of bookmarks I/O operations. At profile creation, the bookmarks task runner is stopped and its execution is started after the profile has finished loading. BUG=NONE Review URL: https://chromiumcodereview.appspot.com/12952005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194956 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/bookmarks/bookmark_model.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'chrome/browser/bookmarks/bookmark_model.cc') diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index 150afd4..d23f645 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -232,7 +232,8 @@ void BookmarkModel::Shutdown() { loaded_signal_.Signal(); } -void BookmarkModel::Load() { +void BookmarkModel::Load( + const scoped_refptr& task_runner) { if (store_.get()) { // If the store is non-null, it means Load was already invoked. Load should // only be invoked once. @@ -249,7 +250,7 @@ void BookmarkModel::Load() { content::Source(profile_)); // Load the bookmarks. BookmarkStorage notifies us when done. - store_ = new BookmarkStorage(profile_, this, profile_->GetIOTaskRunner()); + store_ = new BookmarkStorage(profile_, this, task_runner); store_->LoadBookmarks(CreateLoadDetails()); } -- cgit v1.1