Chromium Code Reviews| 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 // | |
|
Jialiu Lin
2016/04/04 22:05:21
empty line instead of the last "//"?
Nathan Parker
2016/04/05 23:20:31
Done.
| |
| 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 { | |
| 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. | |
|
Jialiu Lin
2016/04/04 22:05:21
If "user gesture" and "user action" refer to the s
Nathan Parker
2016/04/05 23:20:31
Done.
| |
| 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. | |
|
Jialiu Lin
2016/04/04 22:05:21
Remove "The" at the beginning?
Nathan Parker
2016/04/05 23:20:31
Done.
| |
| 45 // | |
| 46 // Criteria for disallowing a file type from opening automatically: | |
| 47 // | |
| 48 // Includes file types that upon opening may either: | |
|
Jialiu Lin
2016/04/04 22:05:21
maybe add indentation or bulleted symbol to indica
Nathan Parker
2016/04/05 23:20:31
Done.
| |
| 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: | |
|
Jialiu Lin
2016/04/04 22:05:21
Similar here.
Also, it might sound confusing to pp
Nathan Parker
2016/04/05 23:20:31
Yes, from offline conv: I'll put this in a README.
| |
| 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; | |
| 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. | |
|
Jialiu Lin
2016/04/04 22:05:21
some explanation of "light-ping"? Any "verdict" co
Nathan Parker
2016/04/05 23:20:31
This is explained in the design doc. I'll link to
| |
| 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. | |
|
Jialiu Lin
2016/04/04 22:05:21
Since platform can be ALL, how to handle conflicts
Nathan Parker
2016/04/05 23:20:31
I'll document the behavior. If a platform isn't p
| |
| 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; | |
| 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 |