1// Copyright 2019 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 5syntax = "proto2"; 6 7option optimize_for = LITE_RUNTIME; 8 9package content.devtools.proto; 10 11// The background service we are logging events for. 12// Do not change the tags since these are persisted. 13// Add a corresponding entry in `enums.xml` if a new value is introduced. 14enum BackgroundService { 15 UNKNOWN = 0; 16 TEST_BACKGROUND_SERVICE = 1; 17 BACKGROUND_FETCH = 2; 18 BACKGROUND_SYNC = 3; 19 PUSH_MESSAGING = 4; 20 NOTIFICATIONS = 5; 21 PAYMENT_HANDLER = 6; 22 PERIODIC_BACKGROUND_SYNC = 7; 23 24 // Keep as last, must have the largest tag value. 25 COUNT = 8; 26} 27 28// A proto for storing the background service event with common metadata for 29// all events. 30// 31// Next Tag: 8 32message BackgroundServiceEvent { 33 // Microseconds since windows epoch. 34 optional int64 timestamp = 1; 35 36 // The origin's URL spec. 37 optional string origin = 2; 38 39 optional int64 service_worker_registration_id = 3; 40 41 optional BackgroundService background_service = 4; 42 43 // A descriptive name for the event that is being logged. 44 optional string event_name = 5; 45 46 // The instance this event belongs to. This is for grouping related events. 47 // For example for Background Fetch and Background Sync, this would be the 48 // developer provided ID to create the fetch/sync. 49 optional string instance_id = 6; 50 51 // Additional custom information related to this event. 52 map<string, string> event_metadata = 7; 53}