diff options
author | msarda@chromium.org <msarda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 17:17:33 +0000 |
---|---|---|
committer | msarda@chromium.org <msarda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 17:17:33 +0000 |
commit | afecfb73fdbca719e3a861b3255e68f2c3ef8780 (patch) | |
tree | d10462f24aae74062803c782ae05cfbf6819bd41 /chrome/browser/bookmarks/bookmark_model_factory.cc | |
parent | ac68e24b25c6578e131ba420abeeebddfb7bca0c (diff) | |
download | chromium_src-afecfb73fdbca719e3a861b3255e68f2c3ef8780.zip chromium_src-afecfb73fdbca719e3a861b3255e68f2c3ef8780.tar.gz chromium_src-afecfb73fdbca719e3a861b3255e68f2c3ef8780.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_model_factory.cc')
-rw-r--r-- | chrome/browser/bookmarks/bookmark_model_factory.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model_factory.cc b/chrome/browser/bookmarks/bookmark_model_factory.cc index 1f63b6d..73da8cb 100644 --- a/chrome/browser/bookmarks/bookmark_model_factory.cc +++ b/chrome/browser/bookmarks/bookmark_model_factory.cc @@ -4,11 +4,14 @@ #include "chrome/browser/bookmarks/bookmark_model_factory.h" +#include "base/deferred_sequenced_task_runner.h" #include "base/memory/singleton.h" #include "base/values.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" +#include "chrome/browser/profiles/startup_task_runner_service.h" +#include "chrome/browser/profiles/startup_task_runner_service_factory.h" #include "chrome/common/pref_names.h" #include "components/user_prefs/pref_registry_syncable.h" @@ -38,7 +41,8 @@ BookmarkModelFactory::~BookmarkModelFactory() {} ProfileKeyedService* BookmarkModelFactory::BuildServiceInstanceFor( Profile* profile) const { BookmarkModel* bookmark_model = new BookmarkModel(profile); - bookmark_model->Load(); + bookmark_model->Load(StartupTaskRunnerServiceFactory::GetForProfile(profile)-> + GetBookmarkTaskRunner()); return bookmark_model; } |