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

Unified Diff: components/dom_distiller/core/task_tracker.cc

Issue 575883002: Fix handling of failed distillation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | components/dom_distiller/core/task_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/task_tracker.cc
diff --git a/components/dom_distiller/core/task_tracker.cc b/components/dom_distiller/core/task_tracker.cc
index 316c679c5fd4c31881ad4eb4c71396d55d24918c..d49f83d8d5d9bc4c6a484b3ce03d15793ac084ee 100644
--- a/components/dom_distiller/core/task_tracker.cc
+++ b/components/dom_distiller/core/task_tracker.cc
@@ -60,6 +60,7 @@ void TaskTracker::StartDistiller(DistillerFactory* factory,
void TaskTracker::StartBlobFetcher() {
if (content_store_) {
+ blob_fetcher_running_ = true;
content_store_->LoadContent(entry_,
base::Bind(&TaskTracker::OnBlobFetched,
weak_ptr_factory_.GetWeakPtr()));
@@ -147,11 +148,17 @@ void TaskTracker::OnDistillerFinished(
AddDistilledContentToStore(*distilled_article_);
}
+ // 'distiller_ != null' is used as a signal that distillation is in progress,
+ // so it needs to be released so that we know distillation is done.
+ base::MessageLoop::current()->DeleteSoon(FROM_HERE, distiller_.release());
+
ContentSourceFinished();
}
void TaskTracker::CancelPendingSources() {
- base::MessageLoop::current()->DeleteSoon(FROM_HERE, distiller_.release());
+ if (distiller_) {
+ base::MessageLoop::current()->DeleteSoon(FROM_HERE, distiller_.release());
+ }
}
void TaskTracker::OnBlobFetched(
« no previous file with comments | « no previous file | components/dom_distiller/core/task_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698