#ifndef CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_CONFIG_H_
#define CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_CONFIG_H_
#include <stdint.h>
#include "base/time/time.h"
#include "components/attribution_reporting/constants.h"
#include "components/attribution_reporting/privacy_math.h"
#include "content/common/content_export.h"
namespace content {
struct CONTENT_EXPORT AttributionConfig {
struct CONTENT_EXPORT RateLimitConfig {
RateLimitConfig();
~RateLimitConfig();
[[nodiscard]] bool Validate() const;
base::TimeDelta time_window = base::Days(30);
int64_t max_source_registration_reporting_origins = 100;
int64_t max_attribution_reporting_origins = 10;
int64_t max_attributions = 100;
int max_reporting_origins_per_source_reporting_site = 1;
base::TimeDelta origins_per_site_window = base::Days(1);
friend bool operator==(const RateLimitConfig&,
const RateLimitConfig&) = default;
};
struct CONTENT_EXPORT EventLevelLimit {
EventLevelLimit();
EventLevelLimit(const EventLevelLimit&);
EventLevelLimit(EventLevelLimit&&);
~EventLevelLimit();
EventLevelLimit& operator=(const EventLevelLimit&);
EventLevelLimit& operator=(EventLevelLimit&&);
[[nodiscard]] bool Validate() const;
int max_reports_per_destination = 1024;
friend bool operator==(const EventLevelLimit&,
const EventLevelLimit&) = default;
};
struct CONTENT_EXPORT AggregateLimit {
AggregateLimit();
[[nodiscard]] bool Validate() const;
int max_reports_per_destination = 1024;
base::TimeDelta min_delay;
base::TimeDelta delay_span = base::Minutes(10);
double null_reports_rate_include_source_registration_time =
attribution_reporting::kNullReportsRateIncludeSourceRegistrationTime;
double null_reports_rate_exclude_source_registration_time =
attribution_reporting::kNullReportsRateExcludeSourceRegistrationTime;
int max_aggregatable_reports_per_source = 20;
friend bool operator==(const AggregateLimit&,
const AggregateLimit&) = default;
};
struct CONTENT_EXPORT DestinationRateLimit {
[[nodiscard]] bool Validate() const;
static constexpr base::TimeDelta kPerDayRateLimitWindow = base::Days(1);
int max_total = 200;
int max_per_reporting_site = 50;
base::TimeDelta rate_limit_window = base::Minutes(1);
int max_per_reporting_site_per_day = 100;
friend bool operator==(const DestinationRateLimit&,
const DestinationRateLimit&) = default;
};
struct CONTENT_EXPORT AggregatableDebugRateLimit {
[[nodiscard]] bool Validate() const;
int max_budget_per_context_site = 1048576;
int max_budget_per_context_reporting_site = 65536;
static constexpr base::TimeDelta kRateLimitWindow = base::Days(1);
int max_reports_per_source = 5;
friend bool operator==(const AggregatableDebugRateLimit&,
const AggregatableDebugRateLimit&) = default;
};
AttributionConfig();
AttributionConfig(const AttributionConfig&);
AttributionConfig(AttributionConfig&&);
~AttributionConfig();
AttributionConfig& operator=(const AttributionConfig&);
AttributionConfig& operator=(AttributionConfig&&);
[[nodiscard]] bool Validate() const;
int max_sources_per_origin = 4096;
int max_destinations_per_source_site_reporting_site = 100;
RateLimitConfig rate_limit;
EventLevelLimit event_level_limit;
AggregateLimit aggregate_limit;
DestinationRateLimit destination_rate_limit;
AggregatableDebugRateLimit aggregatable_debug_rate_limit;
attribution_reporting::PrivacyMathConfig privacy_math_config;
friend bool operator==(const AttributionConfig&,
const AttributionConfig&) = default;
};
}
#endif