| OLD | NEW |
| 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/dom_distiller/dom_distiller_service_factory.h" | 5 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
| 10 #include "chrome/browser/profiles/incognito_helpers.h" | 10 #include "chrome/browser/profiles/incognito_helpers.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 : BrowserContextKeyedServiceFactory( | 48 : BrowserContextKeyedServiceFactory( |
| 49 "DomDistillerService", | 49 "DomDistillerService", |
| 50 BrowserContextDependencyManager::GetInstance()) {} | 50 BrowserContextDependencyManager::GetInstance()) {} |
| 51 | 51 |
| 52 DomDistillerServiceFactory::~DomDistillerServiceFactory() {} | 52 DomDistillerServiceFactory::~DomDistillerServiceFactory() {} |
| 53 | 53 |
| 54 KeyedService* DomDistillerServiceFactory::BuildServiceInstanceFor( | 54 KeyedService* DomDistillerServiceFactory::BuildServiceInstanceFor( |
| 55 content::BrowserContext* profile) const { | 55 content::BrowserContext* profile) const { |
| 56 scoped_refptr<base::SequencedTaskRunner> background_task_runner = | 56 scoped_refptr<base::SequencedTaskRunner> background_task_runner = |
| 57 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | 57 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( |
| 58 content::BrowserThread::GetBlockingPool()->GetSequenceToken()); | 58 base::SequencedWorkerPool::GetSequenceToken()); |
| 59 | 59 |
| 60 scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ArticleEntry> > db( | 60 scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ArticleEntry> > db( |
| 61 new leveldb_proto::ProtoDatabaseImpl<ArticleEntry>( | 61 new leveldb_proto::ProtoDatabaseImpl<ArticleEntry>( |
| 62 background_task_runner)); | 62 background_task_runner)); |
| 63 | 63 |
| 64 base::FilePath database_dir( | 64 base::FilePath database_dir( |
| 65 profile->GetPath().Append(FILE_PATH_LITERAL("Articles"))); | 65 profile->GetPath().Append(FILE_PATH_LITERAL("Articles"))); |
| 66 | 66 |
| 67 scoped_ptr<DomDistillerStore> dom_distiller_store( | 67 scoped_ptr<DomDistillerStore> dom_distiller_store( |
| 68 new DomDistillerStore(std::move(db), database_dir)); | 68 new DomDistillerStore(std::move(db), database_dir)); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 95 return service; | 95 return service; |
| 96 } | 96 } |
| 97 | 97 |
| 98 content::BrowserContext* DomDistillerServiceFactory::GetBrowserContextToUse( | 98 content::BrowserContext* DomDistillerServiceFactory::GetBrowserContextToUse( |
| 99 content::BrowserContext* context) const { | 99 content::BrowserContext* context) const { |
| 100 // Makes normal profile and off-the-record profile use same service instance. | 100 // Makes normal profile and off-the-record profile use same service instance. |
| 101 return chrome::GetBrowserContextRedirectedInIncognito(context); | 101 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace dom_distiller | 104 } // namespace dom_distiller |
| OLD | NEW |