OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/dom_distiller/core/distiller.h" | 5 #include "components/dom_distiller/core/distiller.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 DistillerFactoryImpl::DistillerFactoryImpl( | 31 DistillerFactoryImpl::DistillerFactoryImpl( |
32 scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory, | 32 scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory, |
33 const dom_distiller::proto::DomDistillerOptions& dom_distiller_options) | 33 const dom_distiller::proto::DomDistillerOptions& dom_distiller_options) |
34 : distiller_url_fetcher_factory_(distiller_url_fetcher_factory.Pass()), | 34 : distiller_url_fetcher_factory_(distiller_url_fetcher_factory.Pass()), |
35 dom_distiller_options_(dom_distiller_options) { | 35 dom_distiller_options_(dom_distiller_options) { |
36 } | 36 } |
37 | 37 |
38 DistillerFactoryImpl::~DistillerFactoryImpl() {} | 38 DistillerFactoryImpl::~DistillerFactoryImpl() {} |
39 | 39 |
40 scoped_ptr<Distiller> DistillerFactoryImpl::CreateDistiller() { | 40 scoped_ptr<Distiller> DistillerFactoryImpl::CreateDistillerForUrl( |
41 const GURL& unused) { | |
42 // The |unused| GURL is not needed here or now; it'll be specified later for | |
cjhopman
2014/10/29 17:13:41
I don't think the comment is necessary. I'd just d
kuan
2014/10/29 17:26:53
Done.
| |
43 // DistillerPage::DistillPage() via TaskTracker::StartDistiller(). It's only | |
44 // needed if different URLs require different DomDistillerOption's, like the | |
45 // standalone ContentExtractor. | |
41 scoped_ptr<DistillerImpl> distiller(new DistillerImpl( | 46 scoped_ptr<DistillerImpl> distiller(new DistillerImpl( |
42 *distiller_url_fetcher_factory_, dom_distiller_options_)); | 47 *distiller_url_fetcher_factory_, dom_distiller_options_)); |
43 return distiller.Pass(); | 48 return distiller.Pass(); |
44 } | 49 } |
45 | 50 |
46 DistillerImpl::DistilledPageData::DistilledPageData() {} | 51 DistillerImpl::DistilledPageData::DistilledPageData() {} |
47 | 52 |
48 DistillerImpl::DistilledPageData::~DistilledPageData() {} | 53 DistillerImpl::DistilledPageData::~DistilledPageData() {} |
49 | 54 |
50 DistillerImpl::DistillerImpl( | 55 DistillerImpl::DistillerImpl( |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
324 DCHECK(finished_pages_index_.empty()); | 329 DCHECK(finished_pages_index_.empty()); |
325 | 330 |
326 base::AutoReset<bool> dont_delete_this_in_callback(&destruction_allowed_, | 331 base::AutoReset<bool> dont_delete_this_in_callback(&destruction_allowed_, |
327 false); | 332 false); |
328 finished_cb_.Run(article_proto.Pass()); | 333 finished_cb_.Run(article_proto.Pass()); |
329 finished_cb_.Reset(); | 334 finished_cb_.Reset(); |
330 } | 335 } |
331 } | 336 } |
332 | 337 |
333 } // namespace dom_distiller | 338 } // namespace dom_distiller |
OLD | NEW |