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..f64a4f957d67412682d2b0835f6818dabb20d450 |
| --- /dev/null |
| +++ b/components/offline_pages/background/save_page_request.h |
| @@ -0,0 +1,59 @@ |
| +// 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. |
| +class SavePageRequest { |
|
Pete Williamson
2016/04/28 23:16:07
Would this be better as a struct? All the element
fgorski
2016/04/29 05:19:16
Done.
|
| + public: |
| + enum Status { |
| + WAITING, // Component requested a page be saved, but not until a certain |
| + // time in future. |
|
dougarnett
2016/04/29 15:39:14
time => opportune time ? // yeah I know, anothe
fgorski
2016/04/30 18:56:14
updated appropriately.
|
| + ACTIVE, // Page request is active, and coordinator can attempt it when it |
| + // gets a chance to. |
|
Pete Williamson
2016/04/28 23:16:07
SHould we also have an IN-PROGRESS state for reque
fgorski
2016/04/29 05:19:16
Done.
|
| + FAILED, // Page request failed. |
|
Pete Williamson
2016/04/28 23:16:07
I think we need this case. Eventually when zine h
fgorski
2016/04/29 05:19:16
Done.
|
| + EXPIRED, // Save page request expired without being fulfilled. |
| + } |
| + |
| + SavePageRequest(); |
| + ~SavePageRequest(); |
| + |
| + // ID of this request. |
| + int64_t request_id; |
|
Pete Williamson
2016/04/28 23:16:08
Just curious, where does this request_id come from
fgorski
2016/04/29 05:19:16
We can either assign it at the coordinator level o
|
| + |
| + // 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_ |