Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Safe Browsing reporting protocol buffers. | 5 // Safe Browsing reporting protocol buffers. |
| 6 // | 6 // |
| 7 // A ClientMalwareReportRequest is sent when a user opts-in to | 7 // A ClientMalwareReportRequest is sent when a user opts-in to |
| 8 // sending detailed malware reports from the safe browsing interstitial page. | 8 // sending detailed malware reports from the safe browsing interstitial page. |
| 9 // | 9 // |
| 10 // It is a list of Resource messages, which may contain the url of a | 10 // It is a list of Resource messages, which may contain the url of a |
| 11 // resource such as the page in the address bar or any other resource | 11 // resource such as the page in the address bar or any other resource |
| 12 // that was loaded for this page. | 12 // that was loaded for this page. |
| 13 // | 13 // |
| 14 // In addition to the url, a resource can contain HTTP request and response | 14 // In addition to the url, a resource can contain HTTP request and response |
| 15 // headers and bodies. | 15 // headers and bodies. |
| 16 | 16 |
| 17 syntax = "proto2"; | 17 syntax = "proto2"; |
| 18 | 18 |
| 19 option optimize_for = LITE_RUNTIME; | 19 option optimize_for = LITE_RUNTIME; |
| 20 | 20 |
| 21 package safe_browsing; | 21 package safe_browsing; |
| 22 | 22 |
| 23 message ClientMalwareReportRequest { | 23 message ClientMalwareReportRequest { |
| 24 | 24 |
| 25 message HTTPHeader { | 25 message HTTPHeader { |
| 26 required string name = 1; | 26 required bytes name = 1; |
| 27 optional string value = 2; | 27 optional bytes value = 2; |
| 28 } | 28 } |
| 29 | 29 |
| 30 message HTTPRequest { | 30 message HTTPRequest { |
| 31 message FirstLine { | 31 message FirstLine { |
| 32 optional string verb = 1; // Also known as method, eg "GET" | 32 optional bytes verb = 1; // Also known as method, eg "GET" |
| 33 optional string uri = 2; | 33 optional bytes uri = 2; |
| 34 optional string version = 3; | 34 optional bytes version = 3; |
| 35 } | 35 } |
| 36 | 36 |
| 37 optional FirstLine firstline = 1; | 37 optional FirstLine firstline = 1; |
| 38 repeated HTTPHeader headers = 2; | 38 repeated HTTPHeader headers = 2; |
| 39 optional string body = 3; | 39 optional bytes body = 3; |
| 40 | 40 |
| 41 // bodydigest and bodylength can be useful if the report does not | 41 // bodydigest and bodylength can be useful if the report does not |
| 42 // contain the body itself. | 42 // contain the body itself. |
| 43 optional string bodydigest = 4; | 43 optional bytes bodydigest = 4; |
| 44 optional int32 bodylength = 5; | 44 optional int32 bodylength = 5; |
| 45 } | 45 } |
| 46 | 46 |
| 47 message HTTPResponse { | 47 message HTTPResponse { |
| 48 message FirstLine { | 48 message FirstLine { |
| 49 optional int32 code = 1; | 49 optional int32 code = 1; |
| 50 optional string reason = 2; | 50 optional bytes reason = 2; |
| 51 optional string version = 3; | 51 optional bytes version = 3; |
| 52 } | 52 } |
| 53 | 53 |
| 54 optional FirstLine firstline = 1; | 54 optional FirstLine firstline = 1; |
| 55 repeated HTTPHeader headers = 2; | 55 repeated HTTPHeader headers = 2; |
| 56 optional string body = 3; | 56 optional bytes body = 3; |
| 57 | 57 |
| 58 // bodydigest and bodylength can be useful if the report does not | 58 // bodydigest and bodylength can be useful if the report does not |
| 59 // contain the body itself. | 59 // contain the body itself. |
| 60 optional string bodydigest = 4; | 60 optional bytes bodydigest = 4; |
| 61 optional int32 bodylength = 5; | 61 optional int32 bodylength = 5; |
| 62 optional string remote_ip = 6; | 62 optional bytes remote_ip = 6; |
| 63 } | 63 } |
| 64 | 64 |
| 65 message Resource { | 65 message Resource { |
|
lzheng
2011/01/12 22:30:15
Reading the code, it seems to me that we can merge
panayiotis
2011/01/13 02:25:00
You are right, it is much simpler like this.
On
| |
| 66 optional string url = 1; | 66 required int32 id = 1; |
| 67 optional string url = 2; | |
| 68 optional HTTPRequest request = 3; | |
| 69 optional HTTPResponse response = 4; | |
| 70 } | |
| 67 | 71 |
| 68 // URL of the parent frame. | 72 message Node { |
| 69 optional string parent = 2; | 73 required int32 id = 1; // Should be unique per Node. |
| 74 optional int32 parent_id = 2; // Id of the parent, if known. | |
| 75 | |
| 76 // A list of children. The order of the children in this list is | |
| 77 // significant. The |parent_id| field for child nodes can be derived | |
| 78 // from this, but this allows us to be more flexible. | |
| 79 repeated int32 child_ids = 3; | |
|
lzheng
2011/01/12 22:30:15
I don't see this is used?
panayiotis
2011/01/13 02:25:00
This is not used yet, like many other fields in th
| |
| 70 | 80 |
| 71 // Tag that was used to include this resource, eg "iframe" | 81 // Tag that was used to include this resource, eg "iframe" |
| 72 optional string tag_name = 3; | 82 optional string tag_name = 4; |
| 73 | |
| 74 optional HTTPRequest request = 4; | |
| 75 optional HTTPResponse response = 5; | |
| 76 | |
| 77 // A list of children. The order of the children in this list is | |
| 78 // significant. The |parent| field for child nodes can be derived | |
| 79 // from this, but this allows us to be more flexible. | |
| 80 repeated string children = 6; | |
| 81 } | 83 } |
| 82 | 84 |
| 83 // URL of the resource that matches the safe browsing list. | 85 // URL of the resource that matches the safe browsing list. |
| 84 optional string malware_url = 1; | 86 optional string malware_url = 1; |
| 85 | 87 |
| 86 // URL of the page in the address bar. | 88 // URL of the page in the address bar. |
| 87 optional string page_url = 2; | 89 optional string page_url = 2; |
| 88 | 90 |
| 89 optional string referrer_url = 3; | 91 optional string referrer_url = 3; |
| 90 repeated Resource nodes = 4; | 92 repeated Resource resources = 4; |
| 93 repeated Node nodes = 5; | |
| 91 } | 94 } |
| OLD | NEW |