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

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 12952005: Delay bookmarks load while the profile is loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ObjectDestructionOrder unit test. 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 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 "chrome/test/base/testing_profile.h" 5 #include "chrome/test/base/testing_profile.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 // TopSites::Shutdown schedules some tasks (from TopSitesBackend) that need 385 // TopSites::Shutdown schedules some tasks (from TopSitesBackend) that need
386 // to be run to properly shutdown. Run all pending tasks now. This is 386 // to be run to properly shutdown. Run all pending tasks now. This is
387 // normally handled by browser_process shutdown. 387 // normally handled by browser_process shutdown.
388 if (MessageLoop::current()) 388 if (MessageLoop::current())
389 MessageLoop::current()->RunUntilIdle(); 389 MessageLoop::current()->RunUntilIdle();
390 } 390 }
391 } 391 }
392 392
393 static ProfileKeyedService* BuildBookmarkModel(Profile* profile) { 393 static ProfileKeyedService* BuildBookmarkModel(Profile* profile) {
394 BookmarkModel* bookmark_model = new BookmarkModel(profile); 394 BookmarkModel* bookmark_model = new BookmarkModel(profile);
395 bookmark_model->Load(); 395 bookmark_model->Load(profile->GetIOTaskRunner());
396 return bookmark_model; 396 return bookmark_model;
397 } 397 }
398 398
399 399
400 void TestingProfile::CreateBookmarkModel(bool delete_file) { 400 void TestingProfile::CreateBookmarkModel(bool delete_file) {
401 401
402 if (delete_file) { 402 if (delete_file) {
403 base::FilePath path = GetPath(); 403 base::FilePath path = GetPath();
404 path = path.Append(chrome::kBookmarksFileName); 404 path = path.Append(chrome::kBookmarksFileName);
405 file_util::Delete(path, false); 405 file_util::Delete(path, false);
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 787
788 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { 788 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() {
789 DCHECK(!build_called_); 789 DCHECK(!build_called_);
790 build_called_ = true; 790 build_called_ = true;
791 return scoped_ptr<TestingProfile>(new TestingProfile( 791 return scoped_ptr<TestingProfile>(new TestingProfile(
792 path_, 792 path_,
793 delegate_, 793 delegate_,
794 extension_policy_, 794 extension_policy_,
795 pref_service_.Pass())); 795 pref_service_.Pass()));
796 } 796 }
OLDNEW
« chrome/browser/profiles/startup_task_runner_service.cc ('K') | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698