| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 SavePageRequest(int64_t request_id, | 30 SavePageRequest(int64_t request_id, |
| 31 const GURL& url, | 31 const GURL& url, |
| 32 const ClientId& client_id, | 32 const ClientId& client_id, |
| 33 const base::Time& creation_time); | 33 const base::Time& creation_time); |
| 34 SavePageRequest(int64_t request_id, | 34 SavePageRequest(int64_t request_id, |
| 35 const GURL& url, | 35 const GURL& url, |
| 36 const ClientId& client_id, | 36 const ClientId& client_id, |
| 37 const base::Time& creation_time, | 37 const base::Time& creation_time, |
| 38 const base::Time& activation_time); | 38 const base::Time& activation_time); |
| 39 SavePageRequest(const SavePageRequest& other); |
| 39 ~SavePageRequest(); | 40 ~SavePageRequest(); |
| 40 | 41 |
| 41 // Status of this request. | 42 // Status of this request. |
| 42 Status GetStatus(const base::Time& now) const; | 43 Status GetStatus(const base::Time& now) const; |
| 43 | 44 |
| 44 // Updates the |last_attempt_time_| and increments |attempt_count_|. | 45 // Updates the |last_attempt_time_| and increments |attempt_count_|. |
| 45 void MarkAttemptStarted(const base::Time& start_time); | 46 void MarkAttemptStarted(const base::Time& start_time); |
| 46 | 47 |
| 47 // Marks attempt as completed and clears |last_attempt_time_|. | 48 // Marks attempt as completed and clears |last_attempt_time_|. |
| 48 void MarkAttemptCompleted(); | 49 void MarkAttemptCompleted(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Number of attempts made to get the page. | 82 // Number of attempts made to get the page. |
| 82 int attempt_count_; | 83 int attempt_count_; |
| 83 | 84 |
| 84 // Timestamp of the last request starting. | 85 // Timestamp of the last request starting. |
| 85 base::Time last_attempt_time_; | 86 base::Time last_attempt_time_; |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 } // namespace offline_pages | 89 } // namespace offline_pages |
| 89 | 90 |
| 90 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ | 91 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| OLD | NEW |