| Index: ios/chrome/browser/reading_list/reading_list_entry.h
|
| diff --git a/ios/chrome/browser/reading_list/reading_list_entry.h b/ios/chrome/browser/reading_list/reading_list_entry.h
|
| index aad6cb2aa10cdaebaaf55229626c48781a1c2af0..4e3618ee0064f850e1fb7284094f7106b990762c 100644
|
| --- a/ios/chrome/browser/reading_list/reading_list_entry.h
|
| +++ b/ios/chrome/browser/reading_list/reading_list_entry.h
|
| @@ -8,6 +8,7 @@
|
| #include <string>
|
|
|
| #include "base/macros.h"
|
| +#include "net/base/backoff_entry.h"
|
| #include "url/gurl.h"
|
|
|
| // An entry in the reading list. The URL is a unique identifier for an entry, as
|
| @@ -16,6 +17,9 @@
|
| class ReadingListEntry {
|
| public:
|
| ReadingListEntry(const GURL& url, const std::string& title);
|
| + ReadingListEntry(const GURL& url,
|
| + const std::string& title,
|
| + std::unique_ptr<net::BackoffEntry> backoff);
|
| ReadingListEntry(ReadingListEntry&& entry);
|
| ~ReadingListEntry();
|
|
|
| @@ -25,22 +29,28 @@ class ReadingListEntry {
|
| // ERROR where the system will not retry at all.
|
| enum DistillationState { WAITING, PROCESSING, PROCESSED, WILL_RETRY, ERROR };
|
|
|
| + static const net::BackoffEntry::Policy kBackoffPolicy;
|
| +
|
| // The URL of the page the user would like to read later.
|
| const GURL& URL() const;
|
| // The title of the entry. Might be empty.
|
| - const std::string Title() const;
|
| + const std::string& Title() const;
|
| // What state this entry is in.
|
| DistillationState DistilledState() const;
|
| // The local file URL for the distilled version of the page. This should only
|
| // be called if the state is "PROCESSED".
|
| const GURL& DistilledURL() const;
|
| + // The time before the next try. This is automatically increased when the
|
| + // state is set to WILL_RETRY or ERROR from a non-error state.
|
| + base::TimeDelta TimeUntilNextTry() const;
|
|
|
| ReadingListEntry& operator=(ReadingListEntry&& other);
|
| bool operator==(const ReadingListEntry& other) const;
|
|
|
| // Sets the title.
|
| void SetTitle(const std::string& title);
|
| - // Sets the distilled URL and switch the state to PROCESSED.
|
| + // Sets the distilled URL and switch the state to PROCESSED and reset the time
|
| + // until the next try.
|
| void SetDistilledURL(const GURL& url);
|
| // Sets the state to one of PROCESSING, WILL_RETRY or ERROR.
|
| void SetDistilledState(DistillationState distilled_state);
|
| @@ -50,6 +60,7 @@ class ReadingListEntry {
|
| std::string title_;
|
| GURL distilled_url_;
|
| DistillationState distilled_state_;
|
| + std::unique_ptr<net::BackoffEntry> backoff_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ReadingListEntry);
|
| };
|
|
|