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/task_tracker.h" | 5 #include "components/dom_distiller/core/task_tracker.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 | 8 |
9 namespace dom_distiller { | 9 namespace dom_distiller { |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 if (distiller_) { | 29 if (distiller_) { |
30 return; | 30 return; |
31 } | 31 } |
32 if (entry_.pages_size() == 0) { | 32 if (entry_.pages_size() == 0) { |
33 return; | 33 return; |
34 } | 34 } |
35 | 35 |
36 GURL url(entry_.pages(0).url()); | 36 GURL url(entry_.pages(0).url()); |
37 DCHECK(url.is_valid()); | 37 DCHECK(url.is_valid()); |
38 | 38 |
39 distiller_ = factory->CreateDistiller().Pass(); | 39 distiller_ = factory->CreateDistiller(); |
40 distiller_->DistillPage(url, | 40 distiller_->DistillPage(url, |
41 base::Bind(&TaskTracker::OnDistilledDataReady, | 41 base::Bind(&TaskTracker::OnDistilledDataReady, |
42 weak_ptr_factory_.GetWeakPtr())); | 42 weak_ptr_factory_.GetWeakPtr())); |
43 } | 43 } |
44 | 44 |
45 void TaskTracker::StartBlobFetcher() { | 45 void TaskTracker::StartBlobFetcher() { |
46 // TODO(cjhopman): There needs to be some local storage for the distilled | 46 // TODO(cjhopman): There needs to be some local storage for the distilled |
47 // blob. When that happens, this should start some task to fetch the blob for | 47 // blob. When that happens, this should start some task to fetch the blob for |
48 // |entry_| and asynchronously notify |this| when it is done. | 48 // |entry_| and asynchronously notify |this| when it is done. |
49 } | 49 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 distilled_page_ = proto.Pass(); | 128 distilled_page_ = proto.Pass(); |
129 | 129 |
130 entry_.set_title(distilled_page_->title()); | 130 entry_.set_title(distilled_page_->title()); |
131 for (size_t i = 0; i < viewers_.size(); ++i) { | 131 for (size_t i = 0; i < viewers_.size(); ++i) { |
132 NotifyViewer(viewers_[i]); | 132 NotifyViewer(viewers_[i]); |
133 } | 133 } |
134 DoSaveCallback(); | 134 DoSaveCallback(); |
135 } | 135 } |
136 | 136 |
137 } // namespace dom_distiller | 137 } // namespace dom_distiller |
OLD | NEW |