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_OFFLINE_PAGE_CLIENT_POLICY_H_ | |
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_CLIENT_POLICY_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include <string> | |
11 | |
12 #include "base/time/time.h" | |
13 | |
14 namespace offline_pages { | |
15 | |
16 // The struct describing the lifetime policy of offlined pages. | |
fgorski
2016/04/30 17:42:26
nit: offline pages
no "-d"
applies below
romax
2016/05/02 20:33:45
Done.
| |
17 // Page Policies: | |
fgorski
2016/04/30 17:42:25
The following behaviors are controlled by policy
romax
2016/05/02 20:33:45
Done.
| |
18 // a. Automatically offlined or user-initiated. | |
fgorski
2016/04/30 17:42:26
Persistency (lifetime) of the offline page.
romax
2016/05/02 20:33:45
Done.
| |
19 // b. Expiration time of an offlined page | |
20 // c. Limit of number of pages offlined. | |
21 struct LifetimePolicy { | |
22 public: | |
fgorski
2016/04/30 17:42:26
nit: not needed for structs.
romax
2016/05/02 20:33:44
Done.
| |
23 // Type of the client, indicating where the archived page would be saved. | |
fgorski
2016/04/30 17:42:25
and whether it could be kept indefinitely.
romax
2016/05/02 20:33:45
Done.
| |
24 enum class LifetimeType { | |
25 TEMPORARY, | |
26 PERSISTENT, | |
27 }; | |
28 | |
29 // Type of the page generated by the client. | |
30 LifetimeType type; | |
fgorski
2016/04/30 17:42:26
lifetime_type would be a better name
romax
2016/05/02 20:33:44
Done.
| |
31 | |
32 // The time before the page expires. | |
33 base::TimeDelta expire_period; | |
fgorski
2016/04/30 17:42:26
expiration period.
I am wondering if storing that
romax
2016/05/02 20:33:44
Acknowledged.
| |
34 | |
35 // The maximum number of pages allowd generated by this client. | |
fgorski
2016/04/30 17:42:26
allowed to be saved by
dougarnett
2016/05/02 15:32:34
I'm not clear what "this client" means here - is i
romax
2016/05/02 20:33:45
Done.
| |
36 // kPageUnlimited (0) means no limit set. | |
fgorski
2016/04/30 17:42:26
kPageUnlimited should be defined in this file.
romax
2016/05/02 20:33:45
Done.
| |
37 int64_t page_limit; | |
fgorski
2016/04/30 17:42:25
int should be more than enough.
romax
2016/05/02 20:33:45
Done.
| |
38 }; | |
39 | |
40 // The struct describing policies for various namespaces (Bookmark, Last-N etc.) | |
41 // used by offline page model. The name_space is supposed to be key, so that | |
42 // it's sufficient to compare name_space only when doing comparisons. | |
43 struct OfflinePageClientPolicy { | |
44 public: | |
fgorski
2016/04/30 17:42:26
nit: not needed for structs.
romax
2016/05/02 20:33:45
Done.
| |
45 // Namespace to which the policy applied. | |
46 std::string name_space; | |
47 | |
48 // Policy to control the lifetime of a page generated by this namespace. | |
49 LifetimePolicy lifetime_policy; | |
50 }; | |
51 | |
52 } // namespace offline_pages | |
53 | |
54 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_CLIENT_POLICY_H_ | |
OLD | NEW |