#include "chrome/browser/policy/messaging_layer/upload/event_upload_size_controller.h"
#include <algorithm>
#include <limits>
#include <vector>
#include "base/metrics/histogram_functions.h"
#include "chrome/browser/policy/messaging_layer/upload/network_condition_service.h"
#include "components/reporting/proto/synced/record.pb.h"
#include "event_upload_size_controller.h"
#include "file_upload_impl.h"
namespace reporting {
EventUploadSizeController::EventUploadSizeController(
const NetworkConditionService& network_condition_service,
uint64_t new_events_rate,
uint64_t remaining_storage_capacity,
uint64_t max_file_upload_buffer_size)
: … { … }
bool EventUploadSizeController::IsMaximumUploadSizeReached() const { … }
void EventUploadSizeController::AccountForRecord(
const EncryptedRecord& record) { … }
void EventUploadSizeController::AccountForData(size_t size) { … }
uint64_t EventUploadSizeController::GetUploadRate(
const NetworkConditionService& network_condition_service) { … }
uint64_t EventUploadSizeController::GetNewEventsRate() const { … }
uint64_t EventUploadSizeController::GetRemainingStorageCapacity() const { … }
uint64_t EventUploadSizeController::ComputeMaxUploadSize(
const NetworkConditionService& network_condition_service) const { … }
std::vector<EncryptedRecord> EventUploadSizeController::BuildEncryptedRecords(
google::protobuf::RepeatedPtrField<EncryptedRecord> encrypted_records,
EventUploadSizeController&& controller) { … }
std::atomic<bool> EventUploadSizeController::Enabler::enabled_ = …;
void EventUploadSizeController::Enabler::Set(bool enabled) { … }
bool EventUploadSizeController::Enabler::Get() { … }
}