| Index: chrome/browser/dom_distiller/dom_distiller_service_factory.cc
|
| diff --git a/chrome/browser/dom_distiller/dom_distiller_service_factory.cc b/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
|
| index c7b3fb9ce2646f3b3ce640ac104475021e37085b..ae308395582d7fad45840c784d2913c278afe558 100644
|
| --- a/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
|
| +++ b/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
|
| @@ -43,11 +43,9 @@ DomDistillerServiceFactory::~DomDistillerServiceFactory() {}
|
|
|
| BrowserContextKeyedService* DomDistillerServiceFactory::BuildServiceInstanceFor(
|
| content::BrowserContext* profile) const {
|
| - content::URLDataSource::Add(profile, new DomDistillerViewerSource());
|
| -
|
| scoped_refptr<base::SequencedTaskRunner> background_task_runner =
|
| - content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
|
| - content::BrowserThread::GetBlockingPool()->GetSequenceToken());
|
| + content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
|
| + content::BrowserThread::GetBlockingPool()->GetSequenceToken());
|
|
|
| scoped_ptr<DomDistillerDatabase> db(
|
| new DomDistillerDatabase(background_task_runner));
|
| @@ -55,21 +53,25 @@ BrowserContextKeyedService* DomDistillerServiceFactory::BuildServiceInstanceFor(
|
| base::FilePath database_dir(
|
| profile->GetPath().Append(FILE_PATH_LITERAL("Articles")));
|
|
|
| - scoped_ptr<DomDistillerStore> dom_distiller_store(
|
| - new DomDistillerStore(db.PassAs<DomDistillerDatabaseInterface>(),
|
| - database_dir));
|
| + scoped_ptr<DomDistillerStore> dom_distiller_store(new DomDistillerStore(
|
| + db.PassAs<DomDistillerDatabaseInterface>(), database_dir));
|
|
|
| scoped_ptr<DistillerPageFactory> distiller_page_factory(
|
| new DistillerPageWebContentsFactory(profile));
|
| scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory(
|
| new DistillerURLFetcherFactory(profile->GetRequestContext()));
|
| - scoped_ptr<DistillerFactory> distiller_factory(
|
| - new DistillerFactoryImpl(distiller_page_factory.Pass(),
|
| - distiller_url_fetcher_factory.Pass()));
|
| - return new DomDistillerContextKeyedService(
|
| - dom_distiller_store.PassAs<DomDistillerStoreInterface>(),
|
| - distiller_factory.Pass());
|
| + scoped_ptr<DistillerFactory> distiller_factory(new DistillerFactoryImpl(
|
| + distiller_page_factory.Pass(), distiller_url_fetcher_factory.Pass()));
|
| +
|
| + DomDistillerContextKeyedService* service =
|
| + new DomDistillerContextKeyedService(
|
| + dom_distiller_store.PassAs<DomDistillerStoreInterface>(),
|
| + distiller_factory.Pass());
|
| +
|
| + // Set up URL data source for the chrome-distiller:// scheme.
|
| + content::URLDataSource::Add(profile, new DomDistillerViewerSource(service));
|
|
|
| + return service;
|
| }
|
|
|
| content::BrowserContext* DomDistillerServiceFactory::GetBrowserContextToUse(
|
|
|