| 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_CORE_BACKGROUND_SAVE_PAGE_REQUEST_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SAVE_PAGE_REQUEST_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_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 27 matching lines...) Expand all Loading... |
| 38 ~SavePageRequest(); | 38 ~SavePageRequest(); |
| 39 | 39 |
| 40 bool operator==(const SavePageRequest& other) const; | 40 bool operator==(const SavePageRequest& other) const; |
| 41 | 41 |
| 42 // Updates the |last_attempt_time_| and increments |attempt_count_|. | 42 // Updates the |last_attempt_time_| and increments |attempt_count_|. |
| 43 void MarkAttemptStarted(const base::Time& start_time); | 43 void MarkAttemptStarted(const base::Time& start_time); |
| 44 | 44 |
| 45 // Marks attempt as completed and clears |last_attempt_time_|. | 45 // Marks attempt as completed and clears |last_attempt_time_|. |
| 46 void MarkAttemptCompleted(); | 46 void MarkAttemptCompleted(); |
| 47 | 47 |
| 48 // Marks attempt as aborted. Specifically it clears |last_attempt_time_| | 48 // Marks attempt as aborted. This will change the state of an OFFLINING |
| 49 // and decrements |attempt_count_|. | 49 // request to be AVAILABLE. It will not change the state of a PAUSED request. |
| 50 void MarkAttemptAborted(); | 50 void MarkAttemptAborted(); |
| 51 | 51 |
| 52 // Mark the attempt as paused. It is not available for future prerendering | 52 // Mark the attempt as paused. It is not available for future prerendering |
| 53 // until it has been explicitly unpaused. | 53 // until it has been explicitly unpaused. |
| 54 void MarkAttemptPaused(); | 54 void MarkAttemptPaused(); |
| 55 | 55 |
| 56 int64_t request_id() const { return request_id_; } | 56 int64_t request_id() const { return request_id_; } |
| 57 | 57 |
| 58 const GURL& url() const { return url_; } | 58 const GURL& url() const { return url_; } |
| 59 | 59 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // like AGSA or Now.) | 118 // like AGSA or Now.) |
| 119 bool user_requested_; | 119 bool user_requested_; |
| 120 | 120 |
| 121 // The current state of this request | 121 // The current state of this request |
| 122 RequestState state_; | 122 RequestState state_; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace offline_pages | 125 } // namespace offline_pages |
| 126 | 126 |
| 127 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SAVE_PAGE_REQUEST_H_ | 127 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| OLD | NEW |