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

Side by Side Diff: components/dom_distiller/core/article_distillation_update.h

Issue 178303004: Add incremental updates for multipage distillation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_DISTILLATION_UPDATE_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_DISTILLATION_UPDATE_H_
7
8 #include <vector>
9
10 #include "base/memory/ref_counted.h"
11 #include "components/dom_distiller/core/proto/distilled_page.pb.h"
12
13 namespace dom_distiller {
14
15 // Update about an article that is currently under distillation.
16 class ArticleDistillationUpdate {
17 public:
18 typedef base::RefCountedData<DistilledPageProto> RefCountedPageProto;
19
20 ArticleDistillationUpdate(
21 const std::vector<scoped_refptr<RefCountedPageProto> >& pages,
22 bool has_next_page,
23 bool has_prev_page);
24 ~ArticleDistillationUpdate();
25
26 // Returns the distilled page at |index|.
27 const DistilledPageProto& GetDistilledPage(size_t index) const;
28
29 // Returns the size of distilled pages in this update.
30 size_t GetPagesSize() const { return pages_.size(); }
31
32 // Returns true, if article has a next page that is currently under
33 // distillation and that is not part of the distilled pages included in this
34 // update.
35 bool HasNextPage() const { return has_next_page_; }
36
37 // Returns true if article has a previous page that is currently under
38 // distillation and that is not part of the distilled pages included in this
39 // update.
40 bool HasPrevPage() const { return has_prev_page_; }
41
42 private:
43 bool has_next_page_;
44 bool has_prev_page_;
45 // Currently available pages.
46 std::vector<scoped_refptr<RefCountedPageProto> > pages_;
47 };
48
49 } // namespace dom_distiller
50
51 #endif // COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_DISTILLATION_UPDATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698