| 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" |
| 11 #include "components/offline_pages/offline_page_item.h" | 11 #include "components/offline_pages/offline_page_item.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 namespace offline_pages { | 14 namespace offline_pages { |
| 15 | 15 |
| 16 // Class representing a request to save page. | 16 // Class representing a request to save page. |
| 17 class SavePageRequest { | 17 class SavePageRequest { |
| 18 public: | 18 public: |
| 19 enum class Status { | 19 enum class Status { |
| 20 kNotReady, // Component requested a page be saved, but not until | 20 NOT_READY, // Component requested a page be saved, but not until |
| 21 // |activation_time_|. | 21 // |activation_time_|. |
| 22 kPending, // Page request is pending, and coordinator can attempt it | 22 PENDING, // Page request is pending, and coordinator can attempt it |
| 23 // when it gets a chance to. | 23 // when it gets a chance to. |
| 24 kStarted, // The request is currently being processed. | 24 STARTED, // The request is currently being processed. |
| 25 kFailed, // Page request failed many times and will no longer be | 25 FAILED, // Page request failed many times and will no longer be |
| 26 // retried. | 26 // retried. |
| 27 kExpired, // Save page request expired without being fulfilled. | 27 EXPIRED, // Save page request expired without being fulfilled. |
| 28 }; | 28 }; |
| 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, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // Number of attempts made to get the page. | 82 // Number of attempts made to get the page. |
| 83 int attempt_count_; | 83 int attempt_count_; |
| 84 | 84 |
| 85 // Timestamp of the last request starting. | 85 // Timestamp of the last request starting. |
| 86 base::Time last_attempt_time_; | 86 base::Time last_attempt_time_; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace offline_pages | 89 } // namespace offline_pages |
| 90 | 90 |
| 91 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ | 91 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| OLD | NEW |