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

Unified Diff: components/dom_distiller/core/distiller.cc

Issue 254483003: Start requiring DistillerPage for calls to DomDistillerService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/core/distiller.cc
diff --git a/components/dom_distiller/core/distiller.cc b/components/dom_distiller/core/distiller.cc
index d720a5be6bb8750a80f7ed9fb433f6f6fd8f59bc..71ad507408aaa54820e124571da445b470b0c924 100644
--- a/components/dom_distiller/core/distiller.cc
+++ b/components/dom_distiller/core/distiller.cc
@@ -29,16 +29,14 @@ const size_t kMaxPagesInArticle = 32;
namespace dom_distiller {
DistillerFactoryImpl::DistillerFactoryImpl(
- scoped_ptr<DistillerPageFactory> distiller_page_factory,
scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory)
- : distiller_page_factory_(distiller_page_factory.Pass()),
- distiller_url_fetcher_factory_(distiller_url_fetcher_factory.Pass()) {}
+ : distiller_url_fetcher_factory_(distiller_url_fetcher_factory.Pass()) {}
DistillerFactoryImpl::~DistillerFactoryImpl() {}
scoped_ptr<Distiller> DistillerFactoryImpl::CreateDistiller() {
scoped_ptr<DistillerImpl> distiller(new DistillerImpl(
- *distiller_page_factory_, *distiller_url_fetcher_factory_));
+ *distiller_url_fetcher_factory_));
return distiller.PassAs<Distiller>();
}
@@ -47,14 +45,11 @@ DistillerImpl::DistilledPageData::DistilledPageData() {}
DistillerImpl::DistilledPageData::~DistilledPageData() {}
DistillerImpl::DistillerImpl(
- const DistillerPageFactory& distiller_page_factory,
const DistillerURLFetcherFactory& distiller_url_fetcher_factory)
: distiller_url_fetcher_factory_(distiller_url_fetcher_factory),
max_pages_in_article_(kMaxPagesInArticle),
destruction_allowed_(true),
- weak_factory_(this) {
- distiller_page_ = distiller_page_factory.CreateDistillerPage().Pass();
-}
+ weak_factory_(this) {}
DistillerImpl::~DistillerImpl() {
DCHECK(destruction_allowed_);
@@ -96,9 +91,11 @@ DistillerImpl::DistilledPageData* DistillerImpl::GetPageAtIndex(size_t index)
}
void DistillerImpl::DistillPage(const GURL& url,
+ scoped_ptr<DistillerPage> distiller_page,
const DistillationFinishedCallback& finished_cb,
const DistillationUpdateCallback& update_cb) {
DCHECK(AreAllPagesFinished());
+ distiller_page_ = distiller_page.Pass();
finished_cb_ = finished_cb;
update_cb_ = update_cb;

Powered by Google App Engine
This is Rietveld 408576698