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

Side by Side Diff: chrome/browser/precache/precache_manager_factory.cc

Issue 2582133002: Add DependsOn() calls to PrecacheManagerFactory. (Closed)
Patch Set: Created 4 years 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 | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/precache/precache_manager_factory.h" 5 #include "chrome/browser/precache/precache_manager_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 19 matching lines...) Expand all
30 30
31 // static 31 // static
32 PrecacheManagerFactory* PrecacheManagerFactory::GetInstance() { 32 PrecacheManagerFactory* PrecacheManagerFactory::GetInstance() {
33 return base::Singleton<PrecacheManagerFactory>::get(); 33 return base::Singleton<PrecacheManagerFactory>::get();
34 } 34 }
35 35
36 PrecacheManagerFactory::PrecacheManagerFactory() 36 PrecacheManagerFactory::PrecacheManagerFactory()
37 : BrowserContextKeyedServiceFactory( 37 : BrowserContextKeyedServiceFactory(
38 "PrecacheManager", 38 "PrecacheManager",
39 BrowserContextDependencyManager::GetInstance()) { 39 BrowserContextDependencyManager::GetInstance()) {
40 DependsOn(ProfileSyncServiceFactory::GetInstance());
41 DependsOn(HistoryServiceFactory::GetInstance());
42 DependsOn(DataReductionProxyChromeSettingsFactory::GetInstance());
40 } 43 }
41 44
42 PrecacheManagerFactory::~PrecacheManagerFactory() { 45 PrecacheManagerFactory::~PrecacheManagerFactory() {
43 } 46 }
44 47
45 KeyedService* PrecacheManagerFactory::BuildServiceInstanceFor( 48 KeyedService* PrecacheManagerFactory::BuildServiceInstanceFor(
46 content::BrowserContext* browser_context) const { 49 content::BrowserContext* browser_context) const {
47 std::unique_ptr<PrecacheDatabase> precache_database( 50 std::unique_ptr<PrecacheDatabase> precache_database(
48 new PrecacheDatabase()); 51 new PrecacheDatabase());
49 base::FilePath db_path(browser_context->GetPath().Append( 52 base::FilePath db_path(browser_context->GetPath().Append(
50 base::FilePath(FILE_PATH_LITERAL("PrecacheDatabase")))); 53 base::FilePath(FILE_PATH_LITERAL("PrecacheDatabase"))));
51 return new PrecacheManager( 54 return new PrecacheManager(
52 browser_context, 55 browser_context,
53 ProfileSyncServiceFactory::GetSyncServiceForBrowserContext( 56 ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(
54 browser_context), 57 browser_context),
55 HistoryServiceFactory::GetForProfile( 58 HistoryServiceFactory::GetForProfile(
56 Profile::FromBrowserContext(browser_context), 59 Profile::FromBrowserContext(browser_context),
57 ServiceAccessType::IMPLICIT_ACCESS), 60 ServiceAccessType::IMPLICIT_ACCESS),
58 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( 61 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(
59 browser_context), 62 browser_context),
60 db_path, std::move(precache_database)); 63 db_path, std::move(precache_database));
61 } 64 }
62 65
63 } // namespace precache 66 } // namespace precache
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698