Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 12952005: Delay bookmarks load while the profile is loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/profiles/startup_task_runner_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index e157d1f75efa2be903f47e462f7c55133715ca0d..ce4ff02a23bbd36f71b08997855b23387a843f42 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/deferred_sequenced_task_runner.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/metrics/histogram.h"
@@ -25,6 +26,8 @@
#include "chrome/browser/profiles/profile_destroyer.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_metrics.h"
+#include "chrome/browser/profiles/startup_task_runner_service.h"
+#include "chrome/browser/profiles/startup_task_runner_service_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/browser.h"
@@ -847,6 +850,9 @@ void ProfileManager::DoFinalInitForServices(Profile* profile,
// initializing the managed flag if necessary).
ManagedUserServiceFactory::GetForProfile(profile)->Init();
#endif
+ // Start the deferred task runners once the profile is loaded.
+ StartupTaskRunnerServiceFactory::GetForProfile(profile)->
+ StartDeferredTaskRunners();
}
void ProfileManager::DoFinalInitLogging(Profile* profile) {
@@ -1173,12 +1179,17 @@ ProfileManagerWithoutInit::ProfileManagerWithoutInit(
}
void ProfileManager::RegisterTestingProfile(Profile* profile,
- bool add_to_cache) {
+ bool add_to_cache,
+ bool start_deferred_task_runners) {
RegisterProfile(profile, true);
if (add_to_cache) {
InitProfileUserPrefs(profile);
AddProfileToCache(profile);
}
+ if (start_deferred_task_runners) {
+ StartupTaskRunnerServiceFactory::GetForProfile(profile)->
+ StartDeferredTaskRunners();
+ }
}
void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks,
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/profiles/startup_task_runner_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698