Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: components/offline_pages/offline_page_client_policy.h

Issue 1928393003: Using separate directories based on LifetimeType. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW
« no previous file with comments | « components/offline_pages/client_policy_controller_unittest.cc ('k') | components/offline_pages/offline_page_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698