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

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

Issue 189833002: Add a DistilledContentStore (and an in-memory impl) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
Index: components/dom_distiller/core/task_tracker.h
diff --git a/components/dom_distiller/core/task_tracker.h b/components/dom_distiller/core/task_tracker.h
index dc066beeb5419ba7718de95eac5c7764b61ccf2a..6efba4e76e2279862201c86b1657538fcd34a9cc 100644
--- a/components/dom_distiller/core/task_tracker.h
+++ b/components/dom_distiller/core/task_tracker.h
@@ -21,6 +21,7 @@ class GURL;
namespace dom_distiller {
class DistilledArticleProto;
+class DistilledContentStore;
// A handle to a request to view a DOM distiller entry or URL. The request will
// be cancelled when the handle is destroyed.
@@ -75,7 +76,9 @@ class TaskTracker {
void(const ArticleEntry&, const DistilledArticleProto*, bool)>
SaveCallback;
- TaskTracker(const ArticleEntry& entry, CancelCallback callback);
+ TaskTracker(const ArticleEntry& entry,
+ CancelCallback callback,
+ DistilledContentStore* content_store);
~TaskTracker();
// |factory| will not be stored after this call.
@@ -95,6 +98,8 @@ class TaskTracker {
private:
void OnDistillerFinished(scoped_ptr<DistilledArticleProto> distilled_article);
+ void OnBlobFetched(bool success,
+ scoped_ptr<DistilledArticleProto> distilled_article);
void OnDistilledArticleReady(
scoped_ptr<DistilledArticleProto> distilled_article);
@@ -107,20 +112,24 @@ class TaskTracker {
// be called through ScheduleSaveCallbacks.
void DoSaveCallbacks(bool distillation_succeeded);
+ void AddDistilledContentToStore();
+
void RemoveViewer(ViewRequestDelegate* delegate);
void NotifyViewer(ViewRequestDelegate* delegate);
void MaybeCancel();
CancelCallback cancel_callback_;
- std::vector<SaveCallback> save_callbacks_;
- scoped_ptr<Distiller> distiller_;
+ DistilledContentStore* content_store_;
+ std::vector<SaveCallback> save_callbacks_;
// A ViewRequestDelegate will be added to this list when a view request is
// made and removed when the corresponding ViewerHandle is destroyed.
std::vector<ViewRequestDelegate*> viewers_;
+ scoped_ptr<Distiller> distiller_;
+
ArticleEntry entry_;
scoped_ptr<DistilledArticleProto> distilled_article_;

Powered by Google App Engine
This is Rietveld 408576698