Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / autofill / content / browser / risk / proto / fingerprint.proto
blobf176db2bfd373e4fcff0b756a048730dba8a6f49
1 // Copyright 2013 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 // This file contains the definition of protocol buffers for native browser
6 // fingerprinting.
8 syntax = "proto2";
10 option optimize_for = LITE_RUNTIME;
12 package autofill.risk;
14 message Fingerprint {
15   // A simple protocol message to represent objects with width and height.
16   message Dimension {
17     optional int32 width = 1;
18     optional int32 height = 2;
19   }
21   // Characteristics of the user's machine that are relatively durable,
22   // i.e. that are expected to change relatively infrequently.
23   message MachineCharacteristics {
24     // A simple protocol message that represents a plugin.
25     // e.g. flash, shockwave, acrobat reader, gears, picasa
26     message Plugin {
27       optional string name = 1;
28       optional string description = 2;
29       repeated string mime_type = 3;
30       optional string version = 4;
31     }
33     // Information on the CPU.
34     message Cpu {
35       // e.g. "GenuineIntel"
36       optional string vendor_name = 1;
37       // e.g. "Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz\000"
38       optional string brand = 2;
39     }
41     // Information on the GPU.
42     message Graphics {
43       // The GPU manufacturer's vendor id.
44       optional uint32 vendor_id = 1;
46       // The GPU manufacturer's device id for the chip set.
47       optional uint32 device_id = 2;
49       // The driver version on the GPU.
50       optional string driver_version = 3;
52       // The driver date on the GPU.
53       optional string driver_date = 4;
54     }
56     // Browser features that integrate with Risk.
57     enum BrowserFeature {
58       FEATURE_UNKNOWN = 0;  // Should not be reachable.
59       DEPRECATED_FEATURE_AUTOCHECKOUT = 1;
60       FEATURE_REQUEST_AUTOCOMPLETE = 2;
61     }
63     // A hash of the concatenatation of:
64     //   * The username of the user currently logged into computer / device.
65     //   * The user-assigned computer or device name.
66     optional fixed64 user_and_device_name_hash = 1;
68     // Build version string for the current operating system.
69     optional string operating_system_build = 2;
71     // Browser install time (hours since epoch).
72     optional int64 browser_install_time_hours = 3;
74     // Fonts installed on the machine.
75     repeated string font = 4;
77     // Plug-ins installed on the machine.
78     repeated Plugin plugin = 5;
80     // Delta in ms of the device's time zone from UTC.
81     optional int64 utc_offset_ms = 6;
83     // IETF-formatted language tag. e.g. "en", "en-US", "es-419", etc.
84     // http://en.wikipedia.org/wiki/IETF_language_tag
85     optional string browser_language = 7;
87     // User-requested language code of viewed sites. Languages in
88     // accept-languages.
89     repeated string requested_language = 8;
91     // Default charset of the browser. (e.g. ISO-8859-1, obtained from
92     // document.defaultCharset)
93     optional string charset = 9;
95     // The number of physical screens.
96     optional int32 screen_count = 10;
98     // Information about the user's monitor's physical screen size.
99     // (e.g. 1024 x 768)
100     optional Dimension screen_size = 11;
102     // The color depth of the user's screen (obtained from screen.colorDepth
103     // or screen.pixelDepth)
104     optional int32 screen_color_depth = 12;
106     // Information about the size of the portion of the screen that is unusable
107     // to a program (i.e. on Windows, the portion of the screen that is taken
108     // up by the taskbar)
109     optional Dimension unavailable_screen_size = 13;
111     optional string user_agent = 14;
113     // Total size of each hard drive partition.
114     repeated int32 partition_size = 15;
116     optional Cpu cpu = 16;
118     // Total RAM in bytes.
119     optional int64 ram = 17;
121     // Graphics card being used.
122     optional Graphics graphics_card = 18;
124     // Build version string for browser.
125     optional string browser_build = 19;
127     // The client-side feature corresponding to this request.
128     optional BrowserFeature browser_feature = 20;
129   }
131   // Contains properties relating to more transient computer / browser state.
132   message TransientState {
133     // Corresponds to window.innerWidth / innerHeight
134     optional Dimension inner_window_size = 1;
136     // Corresponds to window.outerWidth / outerHeight
137     optional Dimension outer_window_size = 2;
138   }
140   // Measures computer / network performance.
141   message Performance {
142     // Bandwidth in MB/s. network.connection.bandwidth
143     optional float bandwidth = 1;
144     // Whether bandwidth cost is metered. network.connection.metered
145     optional bool metered = 2;
146     // Whether it's wifi, 3g, 2g, etc. network.connection.type
147     optional string network_type = 3;
148   }
150   // Properties describing the user -- especially the user's state in the
151   // physical world.
152   message UserCharacteristics {
153     message Vector {
154       optional int32 x = 1;
155       optional int32 y = 2;
156       optional int32 z = 3;
157     }
159     message Location {
160       // Meters above sea level.
161       optional double altitude = 1;
162       // Latitude in degrees.
163       optional double latitude = 2;
164       // Longitude in degrees.
165       optional double longitude = 3;
166       // Accuracy in meters. 95% probability of being in this radius of
167       // lat / long.
168       optional double accuracy = 4;
169       // Milliseconds since epoch since measurement.
170       optional int64 time_in_ms = 5;
171     }
173     // Average force by finger presses. TouchEvent.force
174     optional float force = 1;
175     // Average finger width. TouchEvent.radiusX
176     optional float touch_width = 2;
177     // Average finger height. TouchEvent.radiusY
178     optional float touch_height = 3;
179     // TouchEvent.rotationAngle
180     optional int32 touch_rotation = 4;
181     // Orientation while user is navigating flow and the device is roughly
182     // stable. x for alpha, y for beta, z for gamma
183     // TODO(isherman): Orientation data is only available asynchronously in
184     // Chrome.
185     optional Vector device_orientation = 5;
186     // Acceleration while measuring orientation.
187     // TODO(isherman): Acceleration data is not available in Chrome.
188     optional Vector device_acceleration = 6;
189     optional Location location = 7;
190   }
192   // Metadata associated with data collection or the user that doesn't actually
193   // fingerprint the device.
194   message Metadata {
195     // When this data was collected / received, in milliseconds since the epoch.
196     optional int64 timestamp_ms = 1;
197     // Obfuscated Gaia id associated with transaction.
198     optional uint64 obfuscated_gaia_id = 2;
199     // Version of the native library generating this proto.
200     // This may be manually bumped when the code populating the proto has
201     // significantly changed.
202     optional int32 fingerprinter_version = 3;
203   }
205   // Computer / browser fingerprint.
206   optional MachineCharacteristics machine_characteristics = 1;
208   optional Performance performance = 2;
210   optional UserCharacteristics user_characteristics = 3;
212   optional TransientState transient_state = 4;
214   // Metadata associated with data collection.
215   optional Metadata metadata = 5;