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

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

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, 8 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 | « components/dom_distiller/core/dom_distiller_service.h ('k') | components/dom_distiller/core/task_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/dom_distiller_service.cc
diff --git a/components/dom_distiller/core/dom_distiller_service.cc b/components/dom_distiller/core/dom_distiller_service.cc
index 0661f6e237d40469d493c062971d8307e9c86c2b..6683da5f18ea5b300c1dcf2cae4f56ecea85c7c2 100644
--- a/components/dom_distiller/core/dom_distiller_service.cc
+++ b/components/dom_distiller/core/dom_distiller_service.cc
@@ -6,6 +6,7 @@
#include "base/guid.h"
#include "base/message_loop/message_loop.h"
+#include "components/dom_distiller/core/distilled_content_store.h"
#include "components/dom_distiller/core/dom_distiller_store.h"
#include "components/dom_distiller/core/proto/distilled_article.pb.h"
#include "components/dom_distiller/core/task_tracker.h"
@@ -38,7 +39,9 @@ void RunArticleAvailableCallback(
DomDistillerService::DomDistillerService(
scoped_ptr<DomDistillerStoreInterface> store,
scoped_ptr<DistillerFactory> distiller_factory)
- : store_(store.Pass()), distiller_factory_(distiller_factory.Pass()) {}
+ : store_(store.Pass()),
+ content_store_(new InMemoryContentStore()),
+ distiller_factory_(distiller_factory.Pass()) {}
DomDistillerService::~DomDistillerService() {}
@@ -79,6 +82,7 @@ const std::string DomDistillerService::AddToList(
task_tracker->AddSaveCallback(base::Bind(
&DomDistillerService::AddDistilledPageToList, base::Unretained(this)));
task_tracker->StartDistiller(distiller_factory_.get());
+ task_tracker->StartBlobFetcher();
}
return task_tracker->GetEntryId();
@@ -118,6 +122,7 @@ scoped_ptr<ViewerHandle> DomDistillerService::ViewEntry(
TaskTracker* task_tracker = GetOrCreateTaskTrackerForEntry(entry);
scoped_ptr<ViewerHandle> viewer_handle = task_tracker->AddViewer(delegate);
task_tracker->StartDistiller(distiller_factory_.get());
+ task_tracker->StartBlobFetcher();
return viewer_handle.Pass();
}
@@ -132,6 +137,7 @@ scoped_ptr<ViewerHandle> DomDistillerService::ViewUrl(
TaskTracker* task_tracker = GetOrCreateTaskTrackerForUrl(url);
scoped_ptr<ViewerHandle> viewer_handle = task_tracker->AddViewer(delegate);
task_tracker->StartDistiller(distiller_factory_.get());
+ task_tracker->StartBlobFetcher();
return viewer_handle.Pass();
}
@@ -177,7 +183,8 @@ TaskTracker* DomDistillerService::GetOrCreateTaskTrackerForEntry(
TaskTracker* DomDistillerService::CreateTaskTracker(const ArticleEntry& entry) {
TaskTracker::CancelCallback cancel_callback =
base::Bind(&DomDistillerService::CancelTask, base::Unretained(this));
- TaskTracker* tracker = new TaskTracker(entry, cancel_callback);
+ TaskTracker* tracker =
+ new TaskTracker(entry, cancel_callback, content_store_.get());
tasks_.push_back(tracker);
return tracker;
}
« no previous file with comments | « components/dom_distiller/core/dom_distiller_service.h ('k') | components/dom_distiller/core/task_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698