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

Side by Side Diff: components/dom_distiller/core/task_tracker.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/task_tracker.h" 5 #include "components/dom_distiller/core/task_tracker.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "components/dom_distiller/core/distilled_content_store.h" 9 #include "components/dom_distiller/core/distilled_content_store.h"
10 #include "components/dom_distiller/core/proto/distilled_article.pb.h" 10 #include "components/dom_distiller/core/proto/distilled_article.pb.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 scoped_ptr<DistillerPage> distiller_page) { 42 scoped_ptr<DistillerPage> distiller_page) {
43 if (distiller_) { 43 if (distiller_) {
44 return; 44 return;
45 } 45 }
46 if (entry_.pages_size() == 0) { 46 if (entry_.pages_size() == 0) {
47 return; 47 return;
48 } 48 }
49 GURL url(entry_.pages(0).url()); 49 GURL url(entry_.pages(0).url());
50 DCHECK(url.is_valid()); 50 DCHECK(url.is_valid());
51 51
52 distiller_ = factory->CreateDistiller(); 52 distiller_ = factory->CreateDistillerForUrl(url);
53 distiller_->DistillPage(url, 53 distiller_->DistillPage(url,
54 distiller_page.Pass(), 54 distiller_page.Pass(),
55 base::Bind(&TaskTracker::OnDistillerFinished, 55 base::Bind(&TaskTracker::OnDistillerFinished,
56 weak_ptr_factory_.GetWeakPtr()), 56 weak_ptr_factory_.GetWeakPtr()),
57 base::Bind(&TaskTracker::OnArticleDistillationUpdated, 57 base::Bind(&TaskTracker::OnArticleDistillationUpdated,
58 weak_ptr_factory_.GetWeakPtr())); 58 weak_ptr_factory_.GetWeakPtr()));
59 } 59 }
60 60
61 void TaskTracker::StartBlobFetcher() { 61 void TaskTracker::StartBlobFetcher() {
62 if (content_store_) { 62 if (content_store_) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 void TaskTracker::AddDistilledContentToStore( 245 void TaskTracker::AddDistilledContentToStore(
246 const DistilledArticleProto& content) { 246 const DistilledArticleProto& content) {
247 if (content_store_) { 247 if (content_store_) {
248 content_store_->SaveContent( 248 content_store_->SaveContent(
249 entry_, content, DistilledContentStore::SaveCallback()); 249 entry_, content, DistilledContentStore::SaveCallback());
250 } 250 }
251 } 251 }
252 252
253 253
254 } // namespace dom_distiller 254 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/dom_distiller/core/fake_distiller.h ('k') | components/dom_distiller/standalone/content_extractor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698