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

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

Issue 178303004: Add incremental updates for multipage distillation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile by adding a header. Created 6 years, 10 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/article_distillation_update.cc
diff --git a/components/dom_distiller/core/article_distillation_update.cc b/components/dom_distiller/core/article_distillation_update.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6a1d53be99ec799f1eb5bd6881dd19d5e30568d4
--- /dev/null
+++ b/components/dom_distiller/core/article_distillation_update.cc
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/dom_distiller/core/article_distillation_update.h"
+
+#include "base/logging.h"
+
+namespace dom_distiller {
+
+ArticleDistillationUpdate::ArticleDistillationUpdate(
+ const std::vector<RefCountedDistilledPageProto>& pages,
+ bool has_next_page,
+ bool has_prev_page) {
+ pages_ = pages;
cjhopman 2014/02/28 02:38:14 These should be initialized in the initializer lis
shashi 2014/03/02 02:53:40 Done.
+ has_next_page_ = has_next_page;
+ has_prev_page_ = has_prev_page;
+}
+
+ArticleDistillationUpdate::~ArticleDistillationUpdate() {}
+
+const ArticleDistillationUpdate::RefCountedDistilledPageProto
+ArticleDistillationUpdate::getDistilledPage(size_t index) const {
+ DCHECK_GT(pages_.size(), index);
+ return pages_[index];
+}
+
+size_t ArticleDistillationUpdate::getPagesSize() const { return pages_.size(); }
cjhopman 2014/02/28 02:38:14 These three could be inlined in the header.
shashi 2014/03/02 02:53:40 Done.
+
+bool ArticleDistillationUpdate::hasNextPage() const { return has_next_page_; }
+
+bool ArticleDistillationUpdate::hasPrevPage() const { return has_prev_page_; }
+
+} // namespace dom_distiller

Powered by Google App Engine
This is Rietveld 408576698