Chromium Code Reviews| 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/pick_request_task_factory.h" | |
| 6 | |
| 7 #include "components/offline_pages/background/request_coordinator_event_logger.h " | |
| 8 | |
| 9 namespace offline_pages { | |
| 10 | |
| 11 // Capture the common parameters that we will need to make a pick task, | |
| 12 // and use them when making tasks. Create this once each session, and | |
| 13 // use it to build a picker task when needed. | |
| 14 PickRequestTaskFactory::PickRequestTaskFactory( | |
| 15 OfflinerPolicy* policy, | |
|
fgorski
2016/11/09 17:58:07
missing include
Pete Williamson
2016/11/09 23:53:55
Done.
| |
| 16 RequestNotifier* notifier, | |
|
fgorski
2016/11/09 17:58:07
missing include
Pete Williamson
2016/11/09 23:53:55
Done.
| |
| 17 RequestCoordinatorEventLogger* event_logger) | |
| 18 : policy_(policy), notifier_(notifier), event_logger_(event_logger) {} | |
| 19 | |
| 20 PickRequestTaskFactory::~PickRequestTaskFactory() {} | |
| 21 | |
| 22 std::unique_ptr<PickRequestTask> PickRequestTaskFactory::CreatePickerTask( | |
| 23 RequestQueueStore* store, | |
| 24 const PickRequestTask::RequestPickedCallback& picked_callback, | |
| 25 const PickRequestTask::RequestNotPickedCallback& not_picked_callback, | |
| 26 DeviceConditions& conditions, | |
| 27 std::set<int64_t>& disabled_requests) { | |
| 28 std::unique_ptr<PickRequestTask> task; | |
|
fgorski
2016/11/09 17:58:07
nit: why not construct it in one line?
Pete Williamson
2016/11/09 23:53:55
Done. I didn't do it in the first place because I
fgorski
2016/11/10 19:15:50
Acknowledged.
| |
| 29 task.reset(new PickRequestTask(store, policy_, notifier_, event_logger_, | |
| 30 picked_callback, not_picked_callback, | |
| 31 conditions, disabled_requests)); | |
| 32 return task; | |
| 33 } | |
| 34 | |
| 35 } // namespace offline_pages | |
| OLD | NEW |