Chromium Code Reviews| Index: ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc |
| diff --git a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc |
| index 2367b1283b5611de59c520080d8efea42230adb7..cc707d179a1f8089be7bbfdd395f79f9247fa825 100644 |
| --- a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc |
| +++ b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/files/file_path.h" |
| #include "base/macros.h" |
| #include "base/memory/ptr_util.h" |
| +#include "base/memory/ptr_util.h" |
|
Olivier
2016/12/13 14:29:10
remove
gambard
2016/12/13 16:25:53
Done.
|
| #include "base/memory/singleton.h" |
| #include "base/threading/sequenced_worker_pool.h" |
| #include "components/dom_distiller/core/article_entry.h" |
| @@ -22,15 +23,15 @@ |
| #include "components/leveldb_proto/proto_database_impl.h" |
| #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" |
| #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| +#include "ios/chrome/browser/dom_distiller/web_state_dispatcher_impl.h" |
| #include "ios/web/public/browser_state.h" |
| #include "ios/web/public/web_thread.h" |
| namespace { |
| // A simple wrapper for DomDistillerService to expose it as a |
| // KeyedService. |
| -class DomDistillerKeyedService |
| - : public KeyedService, |
| - public dom_distiller::DomDistillerService { |
| +class DomDistillerKeyedService : public KeyedService, |
| + public dom_distiller::DomDistillerService { |
| public: |
| DomDistillerKeyedService( |
| std::unique_ptr<dom_distiller::DomDistillerStoreInterface> store, |
| @@ -67,11 +68,9 @@ DomDistillerService* DomDistillerServiceFactory::GetForBrowserState( |
| DomDistillerServiceFactory::DomDistillerServiceFactory() |
| : BrowserStateKeyedServiceFactory( |
|
Olivier
2016/12/13 14:29:10
I think you know need some DependsOn here.
gambard
2016/12/13 16:25:53
Depends on what?
Olivier
2016/12/13 16:31:21
You are calling code that calls FaviconServiceFact
gambard
2016/12/16 10:26:47
Done.
|
| "DomDistillerService", |
| - BrowserStateDependencyManager::GetInstance()) { |
| -} |
| + BrowserStateDependencyManager::GetInstance()) {} |
| -DomDistillerServiceFactory::~DomDistillerServiceFactory() { |
| -} |
| +DomDistillerServiceFactory::~DomDistillerServiceFactory() {} |
| std::unique_ptr<KeyedService> |
| DomDistillerServiceFactory::BuildServiceInstanceFor( |
| @@ -90,8 +89,11 @@ DomDistillerServiceFactory::BuildServiceInstanceFor( |
| std::unique_ptr<DomDistillerStore> dom_distiller_store( |
| new DomDistillerStore(std::move(db), database_dir)); |
| + std::unique_ptr<WebStateDispatcher> web_state_dispatcher = |
| + base::MakeUnique<WebStateDispatcherImpl>(context); |
| std::unique_ptr<DistillerPageFactory> distiller_page_factory( |
| - new DistillerPageFactoryIOS(context)); |
| + new DistillerPageFactoryIOS(std::move(web_state_dispatcher))); |
| + |
| std::unique_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory( |
| new DistillerURLFetcherFactory(context->GetRequestContext())); |