1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83

content / browser / aggregation_service / proto / aggregatable_report.proto [blame]

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

// Protos for persisting AggregatableReportRequests.

syntax = "proto3";

package content.proto;

option optimize_for = LITE_RUNTIME;

// Proto equivalent of `blink::mojom::AggregationServiceMode`
enum AggregationServiceMode {
  TEE_BASED = 0;
  EXPERIMENTAL_POPLAR = 1;
}

// Proto equivalent of `blink::mojom::AggregatableReportHistogramContribution`
message AggregatableReportHistogramContribution {
  uint64 bucket_high = 1;
  uint64 bucket_low = 2;
  int32 value = 3;
  optional uint64 filtering_id = 4;
}

// Proto equivalent of `content::AggregationServicePayloadContents`
message AggregationServicePayloadContents {
  enum Operation {
    HISTOGRAM = 0;
  }

  Operation operation = 1;
  repeated AggregatableReportHistogramContribution contributions = 2;
  AggregationServiceMode aggregation_mode = 3;
  int32 max_contributions_allowed = 5;
  optional string aggregation_coordinator_origin = 6;
  optional uint32 filtering_id_max_bytes = 7;

  reserved 4;
  reserved "aggregation_coordinator";
}

// Proto equivalent of `content::AggregatableReportSharedInfo`
message AggregatableReportSharedInfo {
  enum DebugMode {
    DISABLED = 0;
    ENABLED = 1;
  }

  // Stored as microseconds since the Windows epoch (1601-01-01 00:00:00 UTC).
  int64 scheduled_report_time = 1;
  string report_id = 2;
  string reporting_origin = 3;
  DebugMode debug_mode = 4;
  // additional_fields is assumed to be empty (for now)
  string api_version = 5;
  string api_identifier = 6;
}

// Proto equivalent of `content::AggregatableReportRequest`
message AggregatableReportRequest {
  // processing_urls is inferred to be the default value(s).
  AggregationServicePayloadContents payload_contents = 1;
  AggregatableReportSharedInfo shared_info = 2;
  string reporting_path = 3;
  optional uint64 debug_key = 4;
  int32 failed_send_attempts = 5;
  map<string, string> additional_fields = 6;

  // Rough categories of report scheduling delays used for metrics. Keep this
  // synchronized with `content::AggregatableReportRequest::DelayType`. Do not
  // remove or renumber enumerators because protos containing these values are
  // persisted to disk.
  enum DelayType {
    SCHEDULED_WITH_REDUCED_DELAY = 0;
    SCHEDULED_WITH_FULL_DELAY = 1;
    // Unscheduled requests are never scheduled, and thus never written to disk.
    reserved 2;
    reserved "UNSCHEDULED";
  }
  optional DelayType delay_type = 7;
}