| // Copyright 2019 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| syntax = "proto2"; |
| |
| option optimize_for = LITE_RUNTIME; |
| |
| package usage_stats; |
| |
| message WebsiteEvent { |
| // Fully-qualified domain name of the website. Example: "docs.google.com". |
| optional string fqdn = 1; |
| |
| // Timestamp when the event occurred. |
| optional Timestamp timestamp = 2; |
| |
| // Type of the event. |
| enum EventType { |
| UNKNOWN = 0; |
| // The user has started (or resumed) browsing the website. |
| START_BROWSING = 1; |
| // The user has stopped browsing the website. |
| STOP_BROWSING = 2; |
| } |
| optional EventType type = 3; |
| } |
| |
| message Timestamp { |
| optional int64 seconds = 1; |
| optional int32 nanos = 2; |
| } |
| |
| message TokenMapping { |
| optional string token = 1; |
| optional string fqdn = 2; |
| } |
| |
| message Suspension { |
| optional string fqdn = 1; |
| } |
| |
| // Allows for any one of {WebsiteEvent, Suspension, TokenMapping} to be stored |
| // in the same proto database. |
| message UsageStat { |
| oneof value { |
| WebsiteEvent website_event = 1; |
| Suspension suspension = 2; |
| TokenMapping token_mapping = 3; |
| } |
| } |