#include "chrome/browser/policy/messaging_layer/upload/upload_provider.h"
#include <list>
#include <memory>
#include <utility>
#include "base/containers/flat_map.h"
#include "base/memory/ref_counted_delete_on_sequence.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/strcat.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/thread_annotations.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/policy/messaging_layer/upload/configuration_file_controller.h"
#include "chrome/browser/policy/messaging_layer/upload/upload_client.h"
#include "chrome/browser/policy/messaging_layer/util/upload_declarations.h"
#include "components/reporting/proto/synced/configuration_file.pb.h"
#include "components/reporting/proto/synced/record.pb.h"
#include "components/reporting/proto/synced/status.pb.h"
#include "components/reporting/util/backoff_settings.h"
#include "components/reporting/util/status.h"
#include "components/reporting/util/statusor.h"
#include "net/base/backoff_entry.h"
namespace reporting {
namespace {
std::unique_ptr<ConfigurationFileController> CreateConfigurationFileController(
UploadClient::UpdateConfigInMissiveCallback update_config_in_missive_cb) { … }
}
class EncryptedReportingUploadProvider::UploadHelper
: public base::RefCountedDeleteOnSequence<UploadHelper> { … };
EncryptedReportingUploadProvider::UploadHelper::UploadHelper(
ReportSuccessfulUploadCallback report_successful_upload_cb,
EncryptionKeyAttachedCallback encryption_key_attached_cb,
UpdateConfigInMissiveCallback update_config_in_missive_cb,
UploadClientBuilderCb upload_client_builder_cb,
scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner)
: … { … }
EncryptedReportingUploadProvider::UploadHelper::~UploadHelper() { … }
void EncryptedReportingUploadProvider::UploadHelper::
PostNewUploadClientRequest() { … }
void EncryptedReportingUploadProvider::UploadHelper::
TryNewUploadClientRequest() { … }
void EncryptedReportingUploadProvider::UploadHelper::OnUploadClientResult(
StatusOr<std::unique_ptr<UploadClient>> client_result) { … }
void EncryptedReportingUploadProvider::UploadHelper::UpdateConfigFile(
ConfigFile file) { … }
void EncryptedReportingUploadProvider::UploadHelper::EnqueueUpload(
bool need_encryption_key,
std::vector<EncryptedRecord> records,
ScopedReservation scoped_reservation,
UploadEnqueuedCallback enqueued_cb) const { … }
void EncryptedReportingUploadProvider::UploadHelper::EnqueueUploadInternal(
bool need_encryption_key,
std::vector<EncryptedRecord> records,
ScopedReservation scoped_reservation,
UploadEnqueuedCallback enqueued_cb) { … }
EncryptedReportingUploadProvider::EncryptedReportingUploadProvider(
ReportSuccessfulUploadCallback report_successful_upload_cb,
EncryptionKeyAttachedCallback encryption_key_attached_cb,
UpdateConfigInMissiveCallback update_config_in_missive_cb,
UploadClientBuilderCb upload_client_builder_cb)
: … { … }
EncryptedReportingUploadProvider::~EncryptedReportingUploadProvider() = default;
void EncryptedReportingUploadProvider::RequestUploadEncryptedRecords(
bool need_encryption_key,
std::vector<EncryptedRecord> records,
ScopedReservation scoped_reservation,
UploadEnqueuedCallback enqueued_cb) { … }
base::WeakPtr<EncryptedReportingUploadProvider>
EncryptedReportingUploadProvider::GetWeakPtr() { … }
EncryptedReportingUploadProvider::UploadClientBuilderCb
EncryptedReportingUploadProvider::GetUploadClientBuilder() { … }
}