| 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. |
| 17 // Page Policies: |
| 18 // a. Automatically offlined or user-initiated. |
| 19 // b. Expiration time of an offlined page |
| 20 // c. Limit of number of pages offlined. |
| 21 struct LifetimePolicy { |
| 22 public: |
| 23 // Type of the client, indicating where the archived page would be saved. |
| 24 enum class LifetimeType { |
| 25 TEMPORARY, |
| 26 PERSISTENT, |
| 27 }; |
| 28 |
| 29 // Type of the page generated by the client. |
| 30 LifetimeType type; |
| 31 |
| 32 // The time before the page expires. |
| 33 base::TimeDelta expire_period; |
| 34 |
| 35 // The maximum number of pages allowd generated by this client. |
| 36 // kPageUnlimited (0) means no limit set. |
| 37 int64_t page_limit; |
| 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: |
| 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 |