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

Side by Side Diff: chrome/browser/android/offline_pages/prefetch_service_factory.cc

Issue 2811813002: [Offline Pages] Set up the initial prefetching service. (Closed)
Patch Set: Created 3 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698