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 | |
| 5 // Protocol buffer for permission reports sent to the safe browsing client-side | |
| 6 // detection (CSD) frontends. | |
| 7 | |
| 8 syntax = "proto2"; | |
| 9 | |
| 10 option optimize_for = LITE_RUNTIME; | |
| 11 | |
| 12 package safe_browsing; | |
| 13 | |
| 14 // A single Permission Report sent to Safe Browsing client-side detection | |
| 15 // frontends. | |
| 16 message PermissionReportExtension { | |
|
kcarattini
2016/05/25 00:21:28
This isn't actually an extension in this context.
| |
| 17 // The origin (scheme/host/port) of the site requesting the permission. | |
| 18 optional string origin = 1; | |
| 19 | |
| 20 // The permission being requested/acted upon. | |
| 21 optional PermissionType permission = 2; | |
| 22 | |
| 23 // The platform | |
|
raymes
2016/05/24 03:01:45
nit: "." at the end of a comment
stefanocs
2016/05/24 07:07:41
Done.
| |
| 24 optional PlatformType platform_type = 3; | |
|
raymes
2016/05/24 03:01:45
Should this be optional?
kcarattini
2016/05/24 06:01:01
I tried to keep these optional in-line with proto3
| |
| 25 | |
| 26 // When the request was initiated. | |
| 27 repeated RequestTrigger request_trigger = 4; | |
| 28 | |
| 29 // The action the user took. Required. | |
| 30 optional Action action = 5; | |
|
raymes
2016/05/24 03:01:45
This says "required" in the comment but is marked
kcarattini
2016/05/24 06:01:01
See above.
| |
| 31 | |
| 32 // The UI used to complete the action. | |
| 33 optional SourceUI source_ui = 6; | |
|
raymes
2016/05/24 03:01:45
Should this be optional?
kcarattini
2016/05/24 06:01:01
See above.
| |
| 34 | |
| 35 // The relevant field trials enabled for this report. | |
| 36 repeated string field_trials = 7; | |
| 37 | |
| 38 // Platform | |
| 39 enum PlatformType { | |
| 40 PLATFORM_TYPE_UNSPECIFIED = 0; | |
|
raymes
2016/05/24 03:01:45
I know nothing about protocol buffers :P Is _UNSPE
kcarattini
2016/05/24 06:01:01
It was suggested to have an unspecified value for
| |
| 41 DESKTOP = 1; | |
| 42 ANDROID = 2; | |
| 43 } | |
| 44 | |
| 45 // Various request triggers we want to record, e.g. on page load. | |
| 46 enum RequestTrigger { | |
| 47 REQUEST_TRIGGER_UNSPECIFIED = 0; | |
| 48 ONLOAD = 1; | |
| 49 AFTER_GESTURE = 2; | |
| 50 } | |
| 51 | |
| 52 // User Permission Actions | |
| 53 enum Action { | |
| 54 GRANTED = 0; | |
| 55 DENIED = 1; | |
| 56 DISMISSED = 2; | |
| 57 IGNORED = 3; | |
| 58 REVOKED = 4; | |
| 59 } | |
| 60 | |
| 61 // Places in the UI that a permission change can occur. | |
| 62 enum SourceUI { | |
| 63 SOURCE_UI_UNSPECIFIED = 0; | |
| 64 PROMPT = 1; | |
| 65 OIB = 2; | |
| 66 CONTENT_SETTINGS = 3; | |
|
raymes
2016/05/24 03:01:45
Could we remove this and just use SITE_SETTINGS? C
kcarattini
2016/05/24 06:01:01
I'm fine with that. We'll need to change the logs
stefanocs
2016/05/24 07:07:41
Done.
stefanocs
2016/05/24 07:07:41
Done.
| |
| 67 SITE_SETTINGS = 4; | |
| 68 } | |
| 69 | |
| 70 // The various types of permissions. | |
|
raymes
2016/05/24 03:01:45
nit: fill 80 chars
| |
| 71 // This should stay in sync with //src/content/public/browser/permission_type. h | |
| 72 // in the Chromium repository: | |
| 73 // https://code.google.com/p/chromium/codesearch#chromium/src/content/public/b rowser/permission_type.h | |
|
kcarattini
2016/05/23 05:55:52
Is this already in sync with the existing enum? Yo
stefanocs
2016/05/23 06:47:06
It seems it is not. How do I use it directly here?
kcarattini
2016/05/24 01:36:13
Actually, Raymes, I'm curious about the enum in pe
raymes
2016/05/24 03:01:45
I'm not sure - I believe 0 is never used.
kcarattini
2016/05/24 06:01:01
I spoke with Raymes offline, and we decided to kee
stefanocs
2016/05/24 07:07:41
Done.
| |
| 74 enum PermissionType { | |
| 75 // Unknown/invalid API. The zero-index is used in practice to represent | |
| 76 // disabling of all APIs for a given full hash. | |
| 77 UNKNOWN_PERMISSION = 0; | |
| 78 | |
| 79 MIDI_SYSEX = 1; | |
| 80 PUSH_MESSAGING = 2; | |
| 81 NOTIFICATIONS = 3; | |
| 82 GEOLOCATION = 4; | |
| 83 PROTECTED_MEDIA_IDENTIFIER = 5; | |
| 84 MIDI = 6; | |
| 85 DURABLE_STORAGE = 7; | |
| 86 AUDIO_CAPTURE = 8; | |
| 87 VIDEO_CAPTURE = 9; | |
| 88 } | |
| 89 } | |
| OLD | NEW |