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

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: 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 unified diff | Download patch
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 if (delete_file) { 401 if (delete_file) {
402 base::FilePath path = GetPath().Append(chrome::kBookmarksFileName); 402 base::FilePath path = GetPath().Append(chrome::kBookmarksFileName);
403 file_util::Delete(path, false); 403 file_util::Delete(path, false);
404 } 404 }
405 // This will create a bookmark model. 405 // This will create a bookmark model.
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 779
780 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { 780 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() {
781 DCHECK(!build_called_); 781 DCHECK(!build_called_);
782 build_called_ = true; 782 build_called_ = true;
783 return scoped_ptr<TestingProfile>(new TestingProfile( 783 return scoped_ptr<TestingProfile>(new TestingProfile(
784 path_, 784 path_,
785 delegate_, 785 delegate_,
786 extension_policy_, 786 extension_policy_,
787 pref_service_.Pass())); 787 pref_service_.Pass()));
788 } 788 }
OLDNEW
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698