Chromium Code Reviews| Index: components/offline_pages/background/save_page_request.h |
| diff --git a/components/offline_pages/background/save_page_request.h b/components/offline_pages/background/save_page_request.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4b46ec9386c20e606cd527adfc192cdd0e377a7f |
| --- /dev/null |
| +++ b/components/offline_pages/background/save_page_request.h |
| @@ -0,0 +1,61 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| +#define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include "base/time/time.h" |
| +#include "components/offline_pages/offline_page_item.h" |
| +#include "url/gurl.h" |
| + |
| +namespace offline_pages { |
| + |
| +// Class representing a request to save page. |
| +struct SavePageRequest { |
| + public: |
| + enum Status { |
| + 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
|
| + // certain time in future. |
| + 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.
|
| + // it gets a chance to. |
| + IN_PROGRESS, // The request is currently being processed. |
| + FAILED, // Page request failed many times and will no longer be |
| + // retried. |
| + EXPIRED, // Save page request expired without being fulfilled. |
| + }; |
| + |
| + SavePageRequest(); |
| + ~SavePageRequest(); |
| + |
| + // ID of this request. |
| + int64_t request_id; |
| + |
| + // Status of this request. |
| + Status status; |
| + |
| + // Online URL of a page to be offlined. |
| + GURL url; |
| + |
| + // Client ID related to the request. Contains namespace and ID assigned by the |
| + // requester. |
| + ClientId client_id; |
| + |
| + // Time when this request was created. (Alternative 2). |
| + base::Time creation_time; |
| + |
| + // Time when this request will become active. |
| + base::Time request_activation_time; |
| + |
| + // Number of attempts made to get the page. |
| + int attempt_count; |
| + |
| + // Timestamp of the last request starting. |
| + base::Time last_attempt_time; |
| +}; |
| + |
| +} // namespace offline_pages |
| + |
| +#endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_ |