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

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: Indent fixes (full git cl format) 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
« no previous file with comments | « components/dom_distiller/core/distiller.h ('k') | components/dom_distiller/core/distiller_page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0b97958f7d1b352079d626163f09ba7942350abc 100644
--- a/components/dom_distiller/core/distiller.cc
+++ b/components/dom_distiller/core/distiller.cc
@@ -29,16 +29,15 @@ 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_));
+ scoped_ptr<DistillerImpl> distiller(
+ new DistillerImpl(*distiller_url_fetcher_factory_));
return distiller.PassAs<Distiller>();
}
@@ -47,13 +46,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();
}
DistillerImpl::~DistillerImpl() {
@@ -96,9 +93,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;
« no previous file with comments | « components/dom_distiller/core/distiller.h ('k') | components/dom_distiller/core/distiller_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698