| 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" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/optional.h" | 15 #include "base/optional.h" |
| 16 #include "base/rand_util.h" | 16 #include "base/rand_util.h" |
| 17 #include "base/sequenced_task_runner.h" | 17 #include "base/sequenced_task_runner.h" |
| 18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| 19 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 21 #include "components/offline_pages/archive_manager.h" | 21 #include "components/offline_pages/archive_manager.h" |
| 22 #include "components/offline_pages/client_policy_controller.h" | 22 #include "components/offline_pages/client_policy_controller.h" |
| 23 #include "components/offline_pages/offline_page_item.h" | 23 #include "components/offline_pages/offline_page_item.h" |
| 24 #include "components/offline_pages/offline_page_storage_manager.h" | 24 #include "components/offline_pages/offline_page_storage_manager.h" |
| 25 #include "components/offline_pages/proto/offline_pages.pb.h" |
| 25 #include "url/gurl.h" | 26 #include "url/gurl.h" |
| 26 | 27 |
| 27 using ArchiverResult = offline_pages::OfflinePageArchiver::ArchiverResult; | 28 using ArchiverResult = offline_pages::OfflinePageArchiver::ArchiverResult; |
| 28 | 29 |
| 29 namespace offline_pages { | 30 namespace offline_pages { |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 // This enum is used in an UMA histogram. Hence the entries here shouldn't | 34 // This enum is used in an UMA histogram. Hence the entries here shouldn't |
| 34 // be deleted or re-ordered and new ones should be added to the end. | 35 // be deleted or re-ordered and new ones should be added to the end. |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 void OfflinePageModel::RunWhenLoaded(const base::Closure& task) { | 826 void OfflinePageModel::RunWhenLoaded(const base::Closure& task) { |
| 826 if (!is_loaded_) { | 827 if (!is_loaded_) { |
| 827 delayed_tasks_.push_back(task); | 828 delayed_tasks_.push_back(task); |
| 828 return; | 829 return; |
| 829 } | 830 } |
| 830 | 831 |
| 831 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task); | 832 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task); |
| 832 } | 833 } |
| 833 | 834 |
| 834 } // namespace offline_pages | 835 } // namespace offline_pages |
| OLD | NEW |