| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/offline_pages/background/cleanup_task_factory.h" | |
| 6 | |
| 7 #include "components/offline_pages/background/offliner_policy.h" | |
| 8 #include "components/offline_pages/background/request_coordinator_event_logger.h
" | |
| 9 #include "components/offline_pages/background/request_notifier.h" | |
| 10 | |
| 11 namespace offline_pages { | |
| 12 | |
| 13 // Capture the common parameters that we will need to make a pick task, | |
| 14 // and use them when making tasks. Create this once each session, and | |
| 15 // use it to build a picker task when needed. | |
| 16 CleanupTaskFactory::CleanupTaskFactory( | |
| 17 OfflinerPolicy* policy, | |
| 18 RequestNotifier* notifier, | |
| 19 RequestCoordinatorEventLogger* event_logger) | |
| 20 : policy_(policy), notifier_(notifier), event_logger_(event_logger) { | |
| 21 DCHECK(policy); | |
| 22 DCHECK(notifier); | |
| 23 DCHECK(event_logger); | |
| 24 } | |
| 25 | |
| 26 CleanupTaskFactory::~CleanupTaskFactory() {} | |
| 27 | |
| 28 std::unique_ptr<CleanupTask> CleanupTaskFactory::CreateCleanupTask( | |
| 29 RequestQueueStore* store) { | |
| 30 std::unique_ptr<CleanupTask> task( | |
| 31 new CleanupTask(store, policy_, notifier_, event_logger_)); | |
| 32 return task; | |
| 33 } | |
| 34 | |
| 35 } // namespace offline_pages | |
| OLD | NEW |