Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ | |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "base/time/time.h" | |
| 11 #include "components/offline_pages/offline_page_item.h" | |
| 12 #include "url/gurl.h" | |
| 13 | |
| 14 namespace offline_pages { | |
| 15 | |
| 16 // Class representing a request to save page. | |
| 17 struct SavePageRequest { | |
| 18 public: | |
| 19 enum Status { | |
| 20 WAITING, // Component requested a page be saved, but not until a | |
|
dougarnett
2016/04/29 15:39:14
I'm not sure about this definition of WAITING. Fro
fgorski
2016/04/30 18:56:14
not ready it is
| |
| 21 // certain time in future. | |
| 22 ACTIVE, // Page request is active, and coordinator can attempt it when | |
|
dougarnett
2016/04/29 15:39:14
ACTIVE name is misleading name to me for this defi
fgorski
2016/04/30 18:56:14
Done.
| |
| 23 // it gets a chance to. | |
| 24 IN_PROGRESS, // The request is currently being processed. | |
| 25 FAILED, // Page request failed many times and will no longer be | |
| 26 // retried. | |
| 27 EXPIRED, // Save page request expired without being fulfilled. | |
| 28 }; | |
| 29 | |
| 30 SavePageRequest(); | |
| 31 ~SavePageRequest(); | |
| 32 | |
| 33 // ID of this request. | |
| 34 int64_t request_id; | |
| 35 | |
| 36 // Status of this request. | |
| 37 Status status; | |
| 38 | |
| 39 // Online URL of a page to be offlined. | |
| 40 GURL url; | |
| 41 | |
| 42 // Client ID related to the request. Contains namespace and ID assigned by the | |
| 43 // requester. | |
| 44 ClientId client_id; | |
| 45 | |
| 46 // Time when this request was created. (Alternative 2). | |
| 47 base::Time creation_time; | |
| 48 | |
| 49 // Time when this request will become active. | |
| 50 base::Time request_activation_time; | |
| 51 | |
| 52 // Number of attempts made to get the page. | |
| 53 int attempt_count; | |
| 54 | |
| 55 // Timestamp of the last request starting. | |
| 56 base::Time last_attempt_time; | |
| 57 }; | |
| 58 | |
| 59 } // namespace offline_pages | |
| 60 | |
| 61 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ | |
| OLD | NEW |