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

Side by Side Diff: components/dom_distiller/core/distiller.cc

Issue 687183003: add options to specify original domain(s) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comment Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/dom_distiller/core/distiller.h ('k') | components/dom_distiller/core/fake_distiller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698