summaryrefslogtreecommitdiffstats
path: root/sync/protocol/attachments.proto
blob: 986e29fced4f6e87a4b9c2ea23970781a7a20dc3 (plain)
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
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Sync protocol for attachments.

// Update proto_{value,enum}_conversions{.h,.cc,_unittest.cc} if you change any
// fields in this file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;
option retain_unknown_fields = true;

package sync_pb;

// Identifies an attachment.
message AttachmentIdProto {
  // Uniquely identifies the attachment. Two attachments with the same unique_id
  // are considered equivalent.
  optional string unique_id = 1;
  // Size of the attachment data in bytes.
  optional uint64 size_bytes = 2;
  // Crc32c of the attachment data.
  optional uint32 crc32c = 3;
}

// Metadata for a single attachment.
message AttachmentMetadataRecord {
  optional AttachmentIdProto id = 1;
  // Indicates we know this attachment exists on the server.
  optional bool is_on_server = 2;
}

// A collection of attachment metadata. This proto is part of EntryKernel's "on
// disk" representation. Private to sync.
message AttachmentMetadata {
  // One record per attachment.
  repeated AttachmentMetadataRecord record = 1;
}