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

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

Issue 2505163004: Move const double data out of header file (Closed)
Patch Set: Remove duplicate comments Created 4 years, 1 month 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
« no previous file with comments | « components/offline_pages/offline_page_storage_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/offline_page_storage_manager.h" 5 #include "components/offline_pages/offline_page_storage_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/time/clock.h" 10 #include "base/time/clock.h"
11 #include "base/time/default_clock.h" 11 #include "base/time/default_clock.h"
12 #include "components/offline_pages/client_policy_controller.h" 12 #include "components/offline_pages/client_policy_controller.h"
13 #include "components/offline_pages/offline_page_client_policy.h" 13 #include "components/offline_pages/offline_page_client_policy.h"
14 #include "components/offline_pages/offline_page_item.h" 14 #include "components/offline_pages/offline_page_item.h"
15 #include "components/offline_pages/offline_page_model.h" 15 #include "components/offline_pages/offline_page_model.h"
16 16
17 using LifetimeType = offline_pages::LifetimePolicy::LifetimeType; 17 using LifetimeType = offline_pages::LifetimePolicy::LifetimeType;
18 18
19 namespace offline_pages { 19 namespace offline_pages {
20 20
21 extern const double kOfflinePageStorageLimit = 0.3;
22 extern const double kOfflinePageStorageClearThreshold = 0.1;
23 extern const base::TimeDelta kClearStorageInterval =
24 base::TimeDelta::FromMinutes(10);
25 extern const base::TimeDelta kRemovePageItemInterval =
26 base::TimeDelta::FromDays(21);
27
21 OfflinePageStorageManager::OfflinePageStorageManager( 28 OfflinePageStorageManager::OfflinePageStorageManager(
22 OfflinePageModel* model, 29 OfflinePageModel* model,
23 ClientPolicyController* policy_controller, 30 ClientPolicyController* policy_controller,
24 ArchiveManager* archive_manager) 31 ArchiveManager* archive_manager)
25 : model_(model), 32 : model_(model),
26 policy_controller_(policy_controller), 33 policy_controller_(policy_controller),
27 archive_manager_(archive_manager), 34 archive_manager_(archive_manager),
28 clock_(new base::DefaultClock()), 35 clock_(new base::DefaultClock()),
29 weak_ptr_factory_(this) {} 36 weak_ptr_factory_(this) {}
30 37
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 policy_controller_->GetPolicy(page.client_id.name_space).lifetime_policy; 212 policy_controller_->GetPolicy(page.client_id.name_space).lifetime_policy;
206 return policy.lifetime_type == LifetimeType::TEMPORARY && 213 return policy.lifetime_type == LifetimeType::TEMPORARY &&
207 clear_time_ - page.last_access_time >= policy.expiration_period; 214 clear_time_ - page.last_access_time >= policy.expiration_period;
208 } 215 }
209 216
210 bool OfflinePageStorageManager::IsInProgress() const { 217 bool OfflinePageStorageManager::IsInProgress() const {
211 return clear_time_ > last_clear_time_; 218 return clear_time_ > last_clear_time_;
212 } 219 }
213 220
214 } // namespace offline_pages 221 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/offline_page_storage_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698