// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Protobuf representation of the DeletionOrigin class.
// If you change or add any fields in this file, update proto_visitors.h and
// potentially proto_enum_conversions.{h, cc}.
syntax = "proto2";
option java_multiple_files = true;
option java_package = "org.chromium.components.sync.protocol";
option optimize_for = LITE_RUNTIME;
package sync_pb;
// Represents a fingerprint-like token that identifies, or may help identity,
// which piece of functionality is responsible for issuing a deletion that
// propagates via Sync. It is sent to the Sync server as part of deletion
// requests, as a safeguard to investigate and mitigate user reports or even
// large-scale incidents.
message DeletionOrigin {
// Populated by chromium-based browsers with the version that originally
// created the deletion. This will often be the same as the version that
// uploaded (committed) the deletion, but in rare cases the latter could be
// greater (i.e. the browser was updated in between).
optional string chromium_version = 1;
// Populated by Android Google Play Services with the version of the APK
// identifying the version that originally created the deletion. This should
// not be populated for DeletionOrigin instances that go through Google Play
// Services but were actually first triggered in chromium.
optional string google_play_services_apk_version_name = 2;
// Hash of the filename in the source code where the deletion originated. The
// precise hashing function is unspecified and may change over time. It may
// only be assumed that the hashing function is the same for a given version
// of the client (see fields above). Hashing is used instead of including the
// actual name to reduce the size of this message.
optional fixed32 file_name_hash = 3;
// Line of code where the deletion originated.
optional int32 file_line_number = 4;
// Human-readable and extra optional version of `file_name_hash`. Since the
// file name can be long and includes the full path, this string is very
// likely truncated (and hence not guaranteed to be unique). Truncation will
// remove the beginning of the string rather than the end of it.
optional string file_name_possibly_truncated = 5;
// Arbitrary but unique tag defined in the source code, when other means
// like the file name and line number aren't possible or desirable. This
// string isn't meant to be too long (recommended limit of 30 characters) and
// is subject to truncation any time. If truncation is used, it will remove
// the beginning of the string rather than the end of it. This field must not
// contain personally-identifiable information.
optional string unique_source_tag_no_pii_possibly_truncated = 6;
}