| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ | 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ |
| 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ | 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // The title of the entry. Might be empty. | 36 // The title of the entry. Might be empty. |
| 37 const std::string& Title() const; | 37 const std::string& Title() const; |
| 38 // What state this entry is in. | 38 // What state this entry is in. |
| 39 DistillationState DistilledState() const; | 39 DistillationState DistilledState() const; |
| 40 // The local file URL for the distilled version of the page. This should only | 40 // The local file URL for the distilled version of the page. This should only |
| 41 // be called if the state is "PROCESSED". | 41 // be called if the state is "PROCESSED". |
| 42 const GURL& DistilledURL() const; | 42 const GURL& DistilledURL() const; |
| 43 // The time before the next try. This is automatically increased when the | 43 // The time before the next try. This is automatically increased when the |
| 44 // state is set to WILL_RETRY or ERROR from a non-error state. | 44 // state is set to WILL_RETRY or ERROR from a non-error state. |
| 45 base::TimeDelta TimeUntilNextTry() const; | 45 base::TimeDelta TimeUntilNextTry() const; |
| 46 // The number of time chrome failed to download this entry. This is |
| 47 // automatically increased when the state is set to WILL_RETRY or ERROR from a |
| 48 // non-error state. |
| 49 int FailedDownloadCounter() const; |
| 46 | 50 |
| 47 ReadingListEntry& operator=(ReadingListEntry&& other); | 51 ReadingListEntry& operator=(ReadingListEntry&& other); |
| 48 bool operator==(const ReadingListEntry& other) const; | 52 bool operator==(const ReadingListEntry& other) const; |
| 49 | 53 |
| 50 // Sets the title. | 54 // Sets the title. |
| 51 void SetTitle(const std::string& title); | 55 void SetTitle(const std::string& title); |
| 52 // Sets the distilled URL and switch the state to PROCESSED and reset the time | 56 // Sets the distilled URL and switch the state to PROCESSED and reset the time |
| 53 // until the next try. | 57 // until the next try. |
| 54 void SetDistilledURL(const GURL& url); | 58 void SetDistilledURL(const GURL& url); |
| 55 // Sets the state to one of PROCESSING, WILL_RETRY or ERROR. | 59 // Sets the state to one of PROCESSING, WILL_RETRY or ERROR. |
| 56 void SetDistilledState(DistillationState distilled_state); | 60 void SetDistilledState(DistillationState distilled_state); |
| 57 | 61 |
| 58 private: | 62 private: |
| 59 GURL url_; | 63 GURL url_; |
| 60 std::string title_; | 64 std::string title_; |
| 61 GURL distilled_url_; | 65 GURL distilled_url_; |
| 62 DistillationState distilled_state_; | 66 DistillationState distilled_state_; |
| 63 std::unique_ptr<net::BackoffEntry> backoff_; | 67 std::unique_ptr<net::BackoffEntry> backoff_; |
| 68 int failed_download_counter_; |
| 64 | 69 |
| 65 DISALLOW_COPY_AND_ASSIGN(ReadingListEntry); | 70 DISALLOW_COPY_AND_ASSIGN(ReadingListEntry); |
| 66 }; | 71 }; |
| 67 | 72 |
| 68 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ | 73 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_ENTRY_H_ |
| OLD | NEW |