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

Side by Side 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 nits. Created 7 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <set> 5 #include <set>
6 6
7 #include "chrome/browser/profiles/profile_manager.h" 7 #include "chrome/browser/profiles/profile_manager.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/deferred_sequenced_task_runner.h"
11 #include "base/file_util.h" 12 #include "base/file_util.h"
12 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
13 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
14 #include "base/prefs/pref_registry_simple.h" 15 #include "base/prefs/pref_registry_simple.h"
15 #include "base/prefs/pref_service.h" 16 #include "base/prefs/pref_service.h"
16 #include "base/string_util.h" 17 #include "base/string_util.h"
17 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
18 #include "base/utf_string_conversions.h" 19 #include "base/utf_string_conversions.h"
19 #include "chrome/browser/bookmarks/bookmark_model.h" 20 #include "chrome/browser/bookmarks/bookmark_model.h"
20 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 21 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 extensions::ExtensionSystem::Get(profile)->extension_service()); 755 extensions::ExtensionSystem::Get(profile)->extension_service());
755 } 756 }
756 } 757 }
757 #endif 758 #endif
758 #if defined(ENABLE_MANAGED_USERS) 759 #if defined(ENABLE_MANAGED_USERS)
759 // Initialization needs to happen after extension system initialization (for 760 // Initialization needs to happen after extension system initialization (for
760 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the 761 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the
761 // initializing the managed flag if necessary). 762 // initializing the managed flag if necessary).
762 ManagedUserServiceFactory::GetForProfile(profile)->Init(); 763 ManagedUserServiceFactory::GetForProfile(profile)->Init();
763 #endif 764 #endif
765 // Start loading the bookmarks after the profile is loaded.
766 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile);
767 model->GetBookmarkTaskRunner()->Start();
Miranda Callahan 2013/03/27 13:31:46 It seems wrong to expose this inner lazy construct
msarda 2013/03/27 14:16:48 Done.
764 } 768 }
765 769
766 void ProfileManager::DoFinalInitLogging(Profile* profile) { 770 void ProfileManager::DoFinalInitLogging(Profile* profile) {
767 // Count number of extensions in this profile. 771 // Count number of extensions in this profile.
768 int extension_count = -1; 772 int extension_count = -1;
769 #if defined(ENABLE_EXTENSIONS) 773 #if defined(ENABLE_EXTENSIONS)
770 ExtensionService* extension_service = profile->GetExtensionService(); 774 ExtensionService* extension_service = profile->GetExtensionService();
771 if (extension_service) 775 if (extension_service)
772 extension_count = extension_service->GetAppIds().size(); 776 extension_count = extension_service->GetAppIds().size();
773 #endif 777 #endif
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 ProfileManager::ProfileInfo::ProfileInfo( 1114 ProfileManager::ProfileInfo::ProfileInfo(
1111 Profile* profile, 1115 Profile* profile,
1112 bool created) 1116 bool created)
1113 : profile(profile), 1117 : profile(profile),
1114 created(created) { 1118 created(created) {
1115 } 1119 }
1116 1120
1117 ProfileManager::ProfileInfo::~ProfileInfo() { 1121 ProfileManager::ProfileInfo::~ProfileInfo() {
1118 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); 1122 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release());
1119 } 1123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698