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

Side by Side Diff: components/offline_pages/client_policy_controller.cc

Issue 2006923005: [Offline Pages] Two-step expiration in storage manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more comments, commit ready. Created 4 years, 6 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/offline_pages/client_policy_controller.h" 5 #include "components/offline_pages/client_policy_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 10
(...skipping 22 matching lines...) Expand all
33 base::TimeDelta::FromDays(1), 10))); 33 base::TimeDelta::FromDays(1), 10)));
34 } 34 }
35 35
36 ClientPolicyController::~ClientPolicyController() {} 36 ClientPolicyController::~ClientPolicyController() {}
37 37
38 // static 38 // static
39 const OfflinePageClientPolicy ClientPolicyController::MakePolicy( 39 const OfflinePageClientPolicy ClientPolicyController::MakePolicy(
40 const std::string& name_space, 40 const std::string& name_space,
41 LifetimeType lifetime_type, 41 LifetimeType lifetime_type,
42 const base::TimeDelta& expire_period, 42 const base::TimeDelta& expire_period,
43 int page_limit) { 43 size_t page_limit) {
44 OfflinePageClientPolicy policy( 44 OfflinePageClientPolicy policy(
45 {name_space, {lifetime_type, expire_period, page_limit}}); 45 {name_space, {lifetime_type, expire_period, page_limit}});
46 return policy; 46 return policy;
47 } 47 }
48 48
49 const OfflinePageClientPolicy& ClientPolicyController::GetPolicy( 49 const OfflinePageClientPolicy& ClientPolicyController::GetPolicy(
50 const std::string& name_space) const { 50 const std::string& name_space) const {
51 const auto& iter = policies_.find(name_space); 51 const auto& iter = policies_.find(name_space);
52 if (iter != policies_.end()) 52 if (iter != policies_.end())
53 return iter->second; 53 return iter->second;
54 // Fallback when the namespace isn't defined. 54 // Fallback when the namespace isn't defined.
55 return policies_.at(kDefaultNamespace); 55 return policies_.at(kDefaultNamespace);
56 } 56 }
57 57
58 } // namespace offline_pages 58 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/client_policy_controller.h ('k') | components/offline_pages/offline_page_client_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698