missive_storage_module_delegate_impl.cc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2021 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. #include "components/reporting/storage/missive_storage_module_delegate_impl.h"
  5. #include <utility>
  6. #include "base/bind.h"
  7. #include "base/callback.h"
  8. #include "base/logging.h"
  9. #include "base/memory/ptr_util.h"
  10. #include "components/reporting/proto/synced/record.pb.h"
  11. #include "components/reporting/proto/synced/record_constants.pb.h"
  12. #include "components/reporting/util/status.h"
  13. namespace reporting {
  14. MissiveStorageModuleDelegateImpl::MissiveStorageModuleDelegateImpl(
  15. AddRecordCallback add_record,
  16. FlushCallback flush)
  17. : add_record_(std::move(add_record)), flush_(std::move(flush)) {}
  18. MissiveStorageModuleDelegateImpl::~MissiveStorageModuleDelegateImpl() = default;
  19. void MissiveStorageModuleDelegateImpl::AddRecord(
  20. Priority priority,
  21. Record record,
  22. MissiveStorageModule::EnqueueCallback callback) {
  23. add_record_.Run(priority, std::move(record), std::move(callback));
  24. }
  25. void MissiveStorageModuleDelegateImpl::Flush(
  26. Priority priority,
  27. MissiveStorageModule::FlushCallback callback) {
  28. flush_.Run(priority, std::move(callback));
  29. }
  30. void MissiveStorageModuleDelegateImpl::ReportSuccess(
  31. const SequenceInformation& sequence_information,
  32. bool force) {
  33. // Intended for upload, but called directly to MissiveClient.
  34. DLOG(FATAL) << "Should never be called";
  35. }
  36. void MissiveStorageModuleDelegateImpl::UpdateEncryptionKey(
  37. const SignedEncryptionInfo& signed_encryption_key) {
  38. // Intended for upload, but called directly to MissiveClient.
  39. DLOG(FATAL) << "Should never be called";
  40. }
  41. } // namespace reporting