| 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 // This default implementation has the same behavior for all URLs. |
| 41 scoped_ptr<DistillerImpl> distiller(new DistillerImpl( | 43 scoped_ptr<DistillerImpl> distiller(new DistillerImpl( |
| 42 *distiller_url_fetcher_factory_, dom_distiller_options_)); | 44 *distiller_url_fetcher_factory_, dom_distiller_options_)); |
| 43 return distiller.Pass(); | 45 return distiller.Pass(); |
| 44 } | 46 } |
| 45 | 47 |
| 46 DistillerImpl::DistilledPageData::DistilledPageData() {} | 48 DistillerImpl::DistilledPageData::DistilledPageData() {} |
| 47 | 49 |
| 48 DistillerImpl::DistilledPageData::~DistilledPageData() {} | 50 DistillerImpl::DistilledPageData::~DistilledPageData() {} |
| 49 | 51 |
| 50 DistillerImpl::DistillerImpl( | 52 DistillerImpl::DistillerImpl( |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 DCHECK(finished_pages_index_.empty()); | 326 DCHECK(finished_pages_index_.empty()); |
| 325 | 327 |
| 326 base::AutoReset<bool> dont_delete_this_in_callback(&destruction_allowed_, | 328 base::AutoReset<bool> dont_delete_this_in_callback(&destruction_allowed_, |
| 327 false); | 329 false); |
| 328 finished_cb_.Run(article_proto.Pass()); | 330 finished_cb_.Run(article_proto.Pass()); |
| 329 finished_cb_.Reset(); | 331 finished_cb_.Reset(); |
| 330 } | 332 } |
| 331 } | 333 } |
| 332 | 334 |
| 333 } // namespace dom_distiller | 335 } // namespace dom_distiller |
| OLD | NEW |