// Copyright 2021 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_REPORTING_CLIENT_REPORT_QUEUE_FACTORY_H_ #define COMPONENTS_REPORTING_CLIENT_REPORT_QUEUE_FACTORY_H_ #include <memory> #include "base/functional/callback.h" #include "base/task/sequenced_task_runner.h" #include "components/reporting/client/report_queue.h" #include "components/reporting/client/report_queue_configuration.h" #include "components/reporting/util/rate_limiter_interface.h" #include "components/reporting/util/statusor.h" #include "net/base/backoff_entry.h" namespace reporting { // Report queue factory simplifies the creation of ReportQueues by abstracting // away both the ReportQueueProvider and the ReportQueueConfiguration. It also // allows automatic retries under the hood if the creation of the ReportQueue // fails. // // To synchronously create `SpeculativeReportQueue`: // ... = ReportQueueFactory::CreateSpeculativeReportQueue( // ReportQueueConfiguration::Create({...}).Set...(...)); // // To asynchronously create `ReportQueue` (currently used in tests only): // ReportQueueFactory::Create( // ReportQueueConfiguration::Create({...}).Set...(...)); // class ReportQueueFactory { … }; } // namespace reporting #endif // COMPONENTS_REPORTING_CLIENT_REPORT_QUEUE_FACTORY_H_