OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/android/offline_pages/prefetch_service_factory.h" | |
6 | |
7 #include <utility> | |
8 | |
9 #include "base/files/file_path.h" | |
10 #include "base/memory/singleton.h" | |
11 #include "base/sequenced_task_runner.h" | |
12 #include "base/threading/sequenced_worker_pool.h" | |
13 #include "chrome/browser/profiles/incognito_helpers.h" | |
14 #include "chrome/browser/profiles/profile.h" | |
15 #include "chrome/common/chrome_constants.h" | |
16 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
17 #include "components/offline_pages/core/offline_page_metadata_store_sql.h" | |
18 #include "components/offline_pages/core/prefetch/prefetch_service_impl.h" | |
19 #include "content/public/browser/browser_thread.h" | |
20 | |
21 namespace offline_pages { | |
22 | |
23 PrefetchServiceFactory::PrefetchServiceFactory() | |
24 : BrowserContextKeyedServiceFactory( | |
25 "OfflinePagePrefetchService", | |
26 BrowserContextDependencyManager::GetInstance()) {} | |
27 | |
28 // static | |
29 PrefetchServiceFactory* PrefetchServiceFactory::GetInstance() { | |
30 return base::Singleton<PrefetchServiceFactory>::get(); | |
31 } | |
32 | |
33 // static | |
34 PrefetchService* PrefetchServiceFactory::GetForBrowserContext( | |
35 content::BrowserContext* context) { | |
36 return static_cast<PrefetchService*>( | |
37 GetInstance()->GetServiceForBrowserContext(context, true)); | |
38 } | |
39 | |
40 KeyedService* PrefetchServiceFactory::BuildServiceInstanceFor( | |
41 content::BrowserContext* context) const { | |
42 scoped_refptr<base::SequencedTaskRunner> background_task_runner = | |
Dmitry Titov
2017/04/11 01:17:13
this seems not used...
dewittj
2017/04/11 21:25:48
Done.
| |
43 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | |
44 content::BrowserThread::GetBlockingPool()->GetSequenceToken()); | |
45 return new PrefetchServiceImpl(); | |
46 } | |
47 | |
48 } // namespace offline_pages | |
OLD | NEW |