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

Side by Side Diff: chrome/browser/bookmarks/startup_task_runner_service_factory.cc

Issue 1165913004: Componentize StartupTaskRunnerService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/browser/profiles/startup_task_runner_service_factory.h" 5 #include "chrome/browser/bookmarks/startup_task_runner_service_factory.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/profiles/startup_task_runner_service.h" 8 #include "components/bookmarks/browser/startup_task_runner_service.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" 9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 10
11 StartupTaskRunnerServiceFactory::StartupTaskRunnerServiceFactory() 11 StartupTaskRunnerServiceFactory::StartupTaskRunnerServiceFactory()
12 : BrowserContextKeyedServiceFactory( 12 : BrowserContextKeyedServiceFactory(
13 "StartupTaskRunnerServiceFactory", 13 "StartupTaskRunnerServiceFactory",
14 BrowserContextDependencyManager::GetInstance()) { 14 BrowserContextDependencyManager::GetInstance()) {
15 } 15 }
16 16
17 StartupTaskRunnerServiceFactory::~StartupTaskRunnerServiceFactory() {} 17 StartupTaskRunnerServiceFactory::~StartupTaskRunnerServiceFactory() {}
18 18
19 // static 19 // static
20 StartupTaskRunnerService* StartupTaskRunnerServiceFactory::GetForProfile( 20 StartupTaskRunnerService* StartupTaskRunnerServiceFactory::GetForProfile(
21 Profile* profile) { 21 Profile* profile) {
22 return static_cast<StartupTaskRunnerService*>( 22 return static_cast<StartupTaskRunnerService*>(
23 GetInstance()->GetServiceForBrowserContext(profile, true)); 23 GetInstance()->GetServiceForBrowserContext(profile, true));
24 } 24 }
25 25
26 // static 26 // static
27 StartupTaskRunnerServiceFactory* 27 StartupTaskRunnerServiceFactory*
28 StartupTaskRunnerServiceFactory::GetInstance() { 28 StartupTaskRunnerServiceFactory::GetInstance() {
29 return Singleton<StartupTaskRunnerServiceFactory>::get(); 29 return Singleton<StartupTaskRunnerServiceFactory>::get();
30 } 30 }
31 31
32 KeyedService* StartupTaskRunnerServiceFactory::BuildServiceInstanceFor( 32 KeyedService* StartupTaskRunnerServiceFactory::BuildServiceInstanceFor(
33 content::BrowserContext* profile) const { 33 content::BrowserContext* context) const {
34 return new StartupTaskRunnerService(static_cast<Profile*>(profile)); 34 Profile* profile = Profile::FromBrowserContext(context);
35 return new StartupTaskRunnerService(profile->GetIOTaskRunner());
35 } 36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698