Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_model.h" | 5 #include "components/offline_pages/offline_page_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 // be deleted or re-ordered and new ones should be added to the end. | 34 // be deleted or re-ordered and new ones should be added to the end. |
| 35 enum ClearAllStatus { | 35 enum ClearAllStatus { |
| 36 CLEAR_ALL_SUCCEEDED, | 36 CLEAR_ALL_SUCCEEDED, |
| 37 STORE_RESET_FAILED, | 37 STORE_RESET_FAILED, |
| 38 STORE_RELOAD_FAILED, | 38 STORE_RELOAD_FAILED, |
| 39 | 39 |
| 40 // NOTE: always keep this entry at the end. | 40 // NOTE: always keep this entry at the end. |
| 41 CLEAR_ALL_STATUS_COUNT | 41 CLEAR_ALL_STATUS_COUNT |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Threshold for how old offline copy of a page should be before we offer to | |
| 45 // delete it to free up space. | |
| 46 const base::TimeDelta kPageCleanUpThreshold = base::TimeDelta::FromDays(30); | |
|
Jeffrey Yasskin
2016/05/13 23:39:43
Apparently (https://build.chromium.org/p/tryserver
| |
| 47 | |
| 48 // The maximum histogram size for the metrics that measure time between views of | 44 // The maximum histogram size for the metrics that measure time between views of |
| 49 // a given page. | 45 // a given page. |
| 50 const base::TimeDelta kMaxOpenedPageHistogramBucket = | 46 const base::TimeDelta kMaxOpenedPageHistogramBucket = |
| 51 base::TimeDelta::FromDays(90); | 47 base::TimeDelta::FromDays(90); |
| 52 | 48 |
| 53 SavePageResult ToSavePageResult(ArchiverResult archiver_result) { | 49 SavePageResult ToSavePageResult(ArchiverResult archiver_result) { |
| 54 SavePageResult result; | 50 SavePageResult result; |
| 55 switch (archiver_result) { | 51 switch (archiver_result) { |
| 56 case ArchiverResult::SUCCESSFULLY_CREATED: | 52 case ArchiverResult::SUCCESSFULLY_CREATED: |
| 57 result = SavePageResult::SUCCESS; | 53 result = SavePageResult::SUCCESS; |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 834 void OfflinePageModel::RunWhenLoaded(const base::Closure& task) { | 830 void OfflinePageModel::RunWhenLoaded(const base::Closure& task) { |
| 835 if (!is_loaded_) { | 831 if (!is_loaded_) { |
| 836 delayed_tasks_.push_back(task); | 832 delayed_tasks_.push_back(task); |
| 837 return; | 833 return; |
| 838 } | 834 } |
| 839 | 835 |
| 840 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task); | 836 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task); |
| 841 } | 837 } |
| 842 | 838 |
| 843 } // namespace offline_pages | 839 } // namespace offline_pages |
| OLD | NEW |