| Index: components/offline_pages/offline_page_client_policy.h
|
| diff --git a/components/offline_pages/offline_page_client_policy.h b/components/offline_pages/offline_page_client_policy.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e2751d49e501148dc05230cc78a17e40ac732c64
|
| --- /dev/null
|
| +++ b/components/offline_pages/offline_page_client_policy.h
|
| @@ -0,0 +1,54 @@
|
| +// 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_OFFLINE_PAGE_CLIENT_POLICY_H_
|
| +#define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_CLIENT_POLICY_H_
|
| +
|
| +#include <stdint.h>
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/time/time.h"
|
| +
|
| +namespace offline_pages {
|
| +
|
| +// The struct describing the lifetime policy of offlined pages.
|
| +// Page Policies:
|
| +// a. Automatically offlined or user-initiated.
|
| +// b. Expiration time of an offlined page
|
| +// c. Limit of number of pages offlined.
|
| +struct LifetimePolicy {
|
| + public:
|
| + // Type of the client, indicating where the archived page would be saved.
|
| + enum class LifetimeType {
|
| + TEMPORARY,
|
| + PERSISTENT,
|
| + };
|
| +
|
| + // Type of the page generated by the client.
|
| + LifetimeType type;
|
| +
|
| + // The time before the page expires.
|
| + base::TimeDelta expire_period;
|
| +
|
| + // The maximum number of pages allowd generated by this client.
|
| + // kPageUnlimited (0) means no limit set.
|
| + int64_t page_limit;
|
| +};
|
| +
|
| +// The struct describing policies for various namespaces (Bookmark, Last-N etc.)
|
| +// used by offline page model. The name_space is supposed to be key, so that
|
| +// it's sufficient to compare name_space only when doing comparisons.
|
| +struct OfflinePageClientPolicy {
|
| + public:
|
| + // Namespace to which the policy applied.
|
| + std::string name_space;
|
| +
|
| + // Policy to control the lifetime of a page generated by this namespace.
|
| + LifetimePolicy lifetime_policy;
|
| +};
|
| +
|
| +} // namespace offline_pages
|
| +
|
| +#endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_CLIENT_POLICY_H_
|
|
|