Chromium Code Reviews| Index: components/offline_pages/background/pick_request_task_builder.h |
| diff --git a/components/offline_pages/background/pick_request_task_builder.h b/components/offline_pages/background/pick_request_task_builder.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5efe83b9f47e353380e5b90e194a01747055b5fe |
| --- /dev/null |
| +++ b/components/offline_pages/background/pick_request_task_builder.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_PICK_REQUEST_TASK_BUILDER_H_ |
| +#define COMPONENTS_OFFLINE_PAGES_BACKGROUND_PICK_REQUEST_TASK_BUILDER_H_ |
| + |
| +#include "components/offline_pages/background/device_conditions.h" |
| + |
|
fgorski
2016/11/03 22:00:29
nit: space not needed.
Pete Williamson
2016/11/04 18:53:37
Done.
|
| +#include "components/offline_pages/background/pick_request_task.h" |
| +#include "components/offline_pages/background/request_coordinator.h" |
| + |
| +namespace offline_pages { |
| + |
| +class OfflinerPolicy; |
| +class RequestCoordinatorEventLogger; |
| +class RequestNotifier; |
| +class RequestQueue; |
| + |
| +class PickRequestTaskBuilder { |
|
fgorski
2016/11/03 22:00:29
Given the interface presented by this class it fee
Pete Williamson
2016/11/04 18:53:37
Doc added.
I'm not sure I understand your request
fgorski
2016/11/04 21:41:28
Yes, I think Factory suits this case better.
Also
|
| + public: |
| + PickRequestTaskBuilder(OfflinerPolicy* policy, |
| + RequestNotifier* notifier, |
| + RequestCoordinatorEventLogger* event_logger); |
| + |
| + ~PickRequestTaskBuilder(); |
| + |
| + std::unique_ptr<PickRequestTask> CreatePickerTask( |
| + RequestQueue* queue, |
| + PickRequestTask::RequestPickedCallback picked_callback, |
| + PickRequestTask::RequestNotPickedCallback not_picked_callback, |
|
fgorski
2016/11/03 22:00:29
Could you use const & for both callbacks, unless y
Pete Williamson
2016/11/04 18:53:37
Done.
|
| + DeviceConditions* conditions, |
| + std::set<int64_t>& disabled_requests); |
| + |
| + private: |
| + // Unowned pointer to the Policy |
| + OfflinerPolicy* policy_; |
| + // Unowned pointer to the notifier |
| + RequestNotifier* notifier_; |
| + // Unowned pointer to the EventLogger |
| + RequestCoordinatorEventLogger* event_logger_; |
| +}; |
| + |
| +} // namespace offline_pages |
| + |
| +#endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_PICK_REQUEST_TASK_BUILDER_H_ |