| 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 COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Status of this request. | 44 // Status of this request. |
| 45 Status GetStatus(const base::Time& now) const; | 45 Status GetStatus(const base::Time& now) const; |
| 46 | 46 |
| 47 // Updates the |last_attempt_time_| and increments |attempt_count_|. | 47 // Updates the |last_attempt_time_| and increments |attempt_count_|. |
| 48 void MarkAttemptStarted(const base::Time& start_time); | 48 void MarkAttemptStarted(const base::Time& start_time); |
| 49 | 49 |
| 50 // Marks attempt as completed and clears |last_attempt_time_|. | 50 // Marks attempt as completed and clears |last_attempt_time_|. |
| 51 void MarkAttemptCompleted(); | 51 void MarkAttemptCompleted(); |
| 52 | 52 |
| 53 // Marks attempt as aborted. Specifically it clears |last_attempt_time_| |
| 54 // and decrements |attempt_count_|. |
| 55 void MarkAttemptAborted(); |
| 56 |
| 53 int64_t request_id() const { return request_id_; } | 57 int64_t request_id() const { return request_id_; } |
| 54 | 58 |
| 55 const GURL& url() const { return url_; } | 59 const GURL& url() const { return url_; } |
| 56 | 60 |
| 57 const ClientId& client_id() const { return client_id_; } | 61 const ClientId& client_id() const { return client_id_; } |
| 58 | 62 |
| 59 const base::Time& creation_time() const { return creation_time_; } | 63 const base::Time& creation_time() const { return creation_time_; } |
| 60 | 64 |
| 61 const base::Time& activation_time() const { return activation_time_; } | 65 const base::Time& activation_time() const { return activation_time_; } |
| 62 | 66 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 base::Time last_attempt_time_; | 104 base::Time last_attempt_time_; |
| 101 | 105 |
| 102 // Whether the user specifically requested this page (as opposed to a client | 106 // Whether the user specifically requested this page (as opposed to a client |
| 103 // like AGSA or Now.) | 107 // like AGSA or Now.) |
| 104 bool user_requested_; | 108 bool user_requested_; |
| 105 }; | 109 }; |
| 106 | 110 |
| 107 } // namespace offline_pages | 111 } // namespace offline_pages |
| 108 | 112 |
| 109 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ | 113 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| OLD | NEW |