OLD | NEW |
---|---|
(Empty) | |
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 // | |
5 syntax = "proto2"; | |
6 | |
7 option optimize_for = LITE_RUNTIME; | |
8 | |
9 package safe_browsing; | |
10 | |
11 // Next id: 5 | |
12 message DownloadFileType { | |
13 // The file extension, without a dot. | |
14 // This must be unique within one DownloadFileTypeConfig | |
15 optional string extension = 1; // required | |
16 | |
17 // Must be unique and not reused, and be consistent with | |
18 // SBClientDownloadExtensions enum in histograms.xml | |
19 optional int64 uma_value = 2; // required | |
20 | |
21 // True if is an archive type. | |
22 optional bool is_archive = 3; // required | |
23 | |
24 | |
25 enum DownloadDangerLevel { | |
asanka
2016/04/06 02:12:30
Nit: The /Download/ prefixes aren't strictly neces
Nathan Parker
2016/04/11 20:12:07
Good call, done.
| |
26 // Safe. Or at least not known to be dangerous. Safe to | |
27 // download and open, even if the download was accidental. | |
28 NOT_DANGEROUS = 0; | |
29 | |
30 // Require confirmation before downloading. An additional user | |
31 // gesture may not be required if the download was from a | |
32 // familiar site and the download was initiated via a user | |
33 // action. | |
34 ALLOW_ON_USER_GESTURE = 1; | |
35 | |
36 // Always require confirmation when downloading. | |
37 DANGEROUS = 2; | |
38 } | |
39 | |
40 enum DownloadAutoOpenHint { | |
41 // File type can be opened automatically. | |
42 ALLOW_AUTO_OPEN = 1; | |
43 | |
44 // The file type should not be allowed to open automatically. | |
45 // | |
46 // Criteria for disallowing a file type from opening automatically: | |
47 // | |
48 // Includes file types that upon opening may either: | |
49 // * ... execute arbitrary or harmful code with user privileges. | |
50 // * ... change configuration of the system to cause harmful behavior | |
51 // immediately or at some time in the future. | |
52 // | |
53 // Doesn't include file types that upon opening: | |
54 // * ... sufficiently warn the user about the fact that: | |
55 // - This file was downloaded from the Internet. | |
56 // - Opening it can make specified changes to the system. | |
57 // (Note that any such warnings need to be displayed prior to | |
58 // the harmful logic being executed). | |
59 // * ... does nothing particularly dangerous, despite the act | |
60 // of downloading itself being dangerous (E.g. .local and | |
61 // .manifest files). | |
62 DISALLOW_AUTO_OPEN = 2; | |
63 } | |
64 | |
65 enum PlatformType { | |
66 ALL = 0; | |
asanka
2016/04/06 02:12:31
This is exposed as DownloadFileType::ALL? Perhaps
Nathan Parker
2016/04/11 20:12:07
I renamed it to PLATFORM_ANY since that's actually
| |
67 PLATFORM_ANDROID = 1; | |
68 PLATFORM_CHROME_OS = 2; | |
69 PLATFORM_LINUX = 3; | |
70 PLATFORM_MAC = 4; | |
71 PLATFORM_WINDOWS = 5; | |
72 } | |
73 | |
74 enum PingSetting { | |
75 // Don’t send pings except maybe light-pings. | |
76 TREAT_AS_UNKNOWN = 0; | |
77 // Don’t send any pings. | |
78 NO_PING = 1; | |
79 // Send full pings and use the verdicts. | |
80 SEND_FULL_PING = 2; | |
81 // Send full pings and but ignore the SAFE verdict. | |
82 SEND_FULL_PING_IGNORE_SAFE = 3; | |
83 } | |
84 | |
85 // Next id: 5 | |
86 message PlatformSettings { | |
87 optional PlatformType platform = 1; | |
88 optional DownloadDangerLevel danger_level = 2; // required | |
89 optional DownloadAutoOpenHint auto_open_hint = 3; // required | |
90 optional PingSetting ping_setting = 4; // required | |
91 }; | |
92 | |
93 // In the canonical list, this must have at least one entry and it can | |
94 // have platform=ALL to act as the default for any OS not listed. In | |
95 // the files served via gstatic, each _<OS>.pb file will have only its | |
96 // own single entry, with |platform| not populated. | |
asanka
2016/04/06 02:12:31
As far as maintainability goes, would it be easier
Nathan Parker
2016/04/11 20:12:07
My plan was to have one asciipb file, but then we
asanka
2016/04/11 20:45:02
SGTM. I had misunderstood what we were going to st
| |
97 repeated PlatformSettings platform_settings = 4; // required >= 1 | |
98 }; | |
99 | |
100 | |
101 // The file_types.asciipb config file is composed of one of these messages. | |
102 // Next id: 5 | |
103 message DownloadFileTypeConfig { | |
104 // Monotonically increasing version number. Will be logged to UMA. | |
105 optional uint32 version_id = 1; | |
106 | |
107 // For what fraction of extended-reporting users’ downloads | |
108 // with unknown extensions should we send light-pings? | |
109 // [0..1] | |
110 optional float light_ping_probability = 2; | |
111 | |
112 // List of all known types. | |
113 repeated DownloadFileType file_type = 3; | |
asanka
2016/04/06 02:12:31
Nit: style guide says this should be called "file_
Nathan Parker
2016/04/11 20:12:07
Done.
| |
114 | |
115 // Settings used if a file is not in the above list. “Extension” is ignored. | |
116 optional DownloadFileType default_file_type = 4; | |
117 } | |
118 | |
OLD | NEW |