Index: ios/chrome/browser/dom_distiller/dom_distiller_service_factory.mm |
diff --git a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.mm |
similarity index 89% |
rename from ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc |
rename to ios/chrome/browser/dom_distiller/dom_distiller_service_factory.mm |
index 2367b1283b5611de59c520080d8efea42230adb7..5e0ba351c80505e25ee80871c7dea03f6fee00ee 100644 |
--- a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc |
+++ b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.mm |
@@ -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" |
#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_pool_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( |
"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<WebStatePool> web_state_pool = |
+ base::MakeUnique<WebStatePoolImpl>(context); |
std::unique_ptr<DistillerPageFactory> distiller_page_factory( |
- new DistillerPageFactoryIOS(context)); |
+ new DistillerPageFactoryIOS(std::move(web_state_pool))); |
+ |
std::unique_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory( |
new DistillerURLFetcherFactory(context->GetRequestContext())); |