1// Copyright 2016 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto2";
6
7option optimize_for = LITE_RUNTIME;
8
9package safe_browsing;
10
11// See //chrome/browser/resources/safe_browsing/README.md for guidelines
12// on how to set fields in this file.
13
14// Next id: 5
15message DownloadFileType {
16  optional string extension = 1;  // required, except in default_file_type.
17  optional int64 uma_value = 2;   // required
18  optional bool is_archive = 3 [default = false];
19
20  enum PingSetting {
21    SAMPLED_PING = 0;
22    NO_PING = 1;
23    FULL_PING = 2;
24  }
25  optional PingSetting ping_setting = 4;  // required
26
27  enum DangerLevel {
28    NOT_DANGEROUS = 0;
29    ALLOW_ON_USER_GESTURE = 1;
30    DANGEROUS = 2;
31  }
32
33  enum AutoOpenHint {
34    DISALLOW_AUTO_OPEN = 0;
35    ALLOW_AUTO_OPEN = 1;
36  }
37
38  enum PlatformType {
39    PLATFORM_ANY = 0;
40    PLATFORM_ANDROID = 1;
41    PLATFORM_CHROME_OS = 2;
42    PLATFORM_LINUX = 3;
43    PLATFORM_MAC = 4;
44    PLATFORM_WINDOWS = 5;
45  }
46
47  // Next id: 5
48  message PlatformSettings {
49    optional PlatformType platform = 1 [default = PLATFORM_ANY];
50    optional DangerLevel danger_level = 2;     // required
51    optional AutoOpenHint auto_open_hint = 3;  // required
52    optional uint64 max_file_size_to_analyze = 4
53        [default = 18446744073709551615];  // (2^64)-1]
54  };
55
56  // Protos parsed by Chrome should have exactly one entry here.
57  repeated PlatformSettings platform_settings = 5;
58
59  // The type of file content inspection we should do, if any.
60  enum InspectionType {
61    NONE = 0;
62    ZIP = 1;
63    RAR = 2;
64    DMG = 3;
65  }
66  optional InspectionType inspection_type = 6;
67};
68
69// Next id: 6
70message DownloadFileTypeConfig {
71  // All required
72  optional uint32 version_id = 1;
73  optional float sampled_ping_probability = 2;
74  repeated DownloadFileType file_types = 3;
75  optional DownloadFileType default_file_type = 4;
76
77  // Limits on repeated fields in the ClientDownloadRequest (i.e. the
78  // download ping). Limits are per-ping.
79  optional uint64 max_archived_binaries_to_report = 5;
80}
81