| 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 28 matching lines...) Expand all Loading... |
| 39 SavePageRequest(const SavePageRequest& other); | 39 SavePageRequest(const SavePageRequest& other); |
| 40 ~SavePageRequest(); | 40 ~SavePageRequest(); |
| 41 | 41 |
| 42 // Status of this request. | 42 // Status of this request. |
| 43 Status GetStatus(const base::Time& now) const; | 43 Status GetStatus(const base::Time& now) const; |
| 44 | 44 |
| 45 // Updates the |last_attempt_time_| and increments |attempt_count_|. | 45 // Updates the |last_attempt_time_| and increments |attempt_count_|. |
| 46 void MarkAttemptStarted(const base::Time& start_time); | 46 void MarkAttemptStarted(const base::Time& start_time); |
| 47 | 47 |
| 48 // Marks attempt as completed and clears |last_attempt_time_|. | 48 // Marks attempt as completed and clears |last_attempt_time_|. |
| 49 void MarkAttemptCompleted(); | 49 void MarkAttemptCompleted(const base::Time& time); |
| 50 | 50 |
| 51 int64_t request_id() const { return request_id_; } | 51 int64_t request_id() const { return request_id_; } |
| 52 | 52 |
| 53 const GURL& url() const { return url_; } | 53 const GURL& url() const { return url_; } |
| 54 | 54 |
| 55 const ClientId& client_id() const { return client_id_; } | 55 const ClientId& client_id() const { return client_id_; } |
| 56 | 56 |
| 57 const base::Time& creation_time() const { return creation_time_; } | 57 const base::Time& creation_time() const { return creation_time_; } |
| 58 | 58 |
| 59 const base::Time& activation_time() const { return activation_time_; } | 59 const base::Time& activation_time() const { return activation_time_; } |
| 60 | 60 |
| 61 int64_t attempt_count() const { return attempt_count_; } | 61 int64_t attempt_count() const { return attempt_count_; } |
| 62 void set_attempt_count(int64_t attempt_count) { |
| 63 attempt_count_ = attempt_count; |
| 64 } |
| 62 | 65 |
| 63 const base::Time& last_attempt_time() const { return last_attempt_time_; } | 66 const base::Time& last_attempt_time() const { return last_attempt_time_; } |
| 64 | 67 |
| 65 private: | 68 private: |
| 66 // ID of this request. | 69 // ID of this request. |
| 67 int64_t request_id_; | 70 int64_t request_id_; |
| 68 | 71 |
| 69 // Online URL of a page to be offlined. | 72 // Online URL of a page to be offlined. |
| 70 GURL url_; | 73 GURL url_; |
| 71 | 74 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 82 // Number of attempts made to get the page. | 85 // Number of attempts made to get the page. |
| 83 int attempt_count_; | 86 int attempt_count_; |
| 84 | 87 |
| 85 // Timestamp of the last request starting. | 88 // Timestamp of the last request starting. |
| 86 base::Time last_attempt_time_; | 89 base::Time last_attempt_time_; |
| 87 }; | 90 }; |
| 88 | 91 |
| 89 } // namespace offline_pages | 92 } // namespace offline_pages |
| 90 | 93 |
| 91 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ | 94 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| OLD | NEW |