chromium/components/ukm/ukm_reporting_service.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ReportingService specialized to report UKM metrics.

#include "components/ukm/ukm_reporting_service.h"

#include <memory>
#include <string_view>

#include "base/command_line.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
#include "components/metrics/metrics_service_client.h"
#include "components/metrics/metrics_switches.h"
#include "components/metrics/unsent_log_store.h"
#include "components/metrics/url_constants.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/ukm/ukm_pref_names.h"
#include "components/ukm/ukm_service.h"
#include "components/ukm/unsent_log_store_metrics_impl.h"
#include "third_party/zlib/google/compression_utils.h"

#if BUILDFLAG(IS_IOS)
#include "components/ukm/ios/ukm_reporting_ios_util.h"
#endif

namespace ukm {

namespace {

// The number of UKM logs that will be stored in UnsentLogStore before logs
// start being dropped.
constexpr int kMinUnsentLogCount =;

// The number of bytes UKM logs that will be stored in UnsentLogStore before
// logs start being dropped.
// This ensures that a reasonable amount of history will be stored even if there
// is a long series of very small logs.
constexpr int kMinUnsentLogBytes =;

// If an upload fails, and the transmission was over this byte count, then we
// will discard the log, and not try to retransmit it.  We also don't persist
// the log to the prefs for transmission during the next chrome session if this
// limit is exceeded.
constexpr size_t kMaxLogRetransmitSize =;

GURL GetServerUrl() {}

}  // namespace

// static
void UkmReportingService::RegisterPrefs(PrefRegistrySimple* registry) {}

UkmReportingService::UkmReportingService(metrics::MetricsServiceClient* client,
                                         PrefService* local_state)
    :{}

UkmReportingService::~UkmReportingService() {}

metrics::LogStore* UkmReportingService::log_store() {}

GURL UkmReportingService::GetUploadUrl() const {}

GURL UkmReportingService::GetInsecureUploadUrl() const {}

std::string_view UkmReportingService::upload_mime_type() const {}

metrics::MetricsLogUploader::MetricServiceType
UkmReportingService::service_type() const {}

void UkmReportingService::LogCellularConstraint(bool upload_canceled) {}

void UkmReportingService::LogResponseOrErrorCode(int response_code,
                                                 int error_code,
                                                 bool was_https) {}

void UkmReportingService::LogSuccessLogSize(size_t log_size) {}

void UkmReportingService::LogSuccessMetadata(const std::string& staged_log) {}

void UkmReportingService::LogLargeRejection(size_t log_size) {}

}  // namespace ukm