1// Copyright 2016 The Chromium Authors 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; 8option java_package = "org.chromium.components.metrics"; 9 10option java_outer_classname = "ExecutionContextProtos"; 11 12package metrics; 13 14// Enums corresponding to the Chrome execution context in which data was 15// collected. 16 17// Chrome process type. Derived from content/public/common/process_type.h. 18enum Process { 19 UNKNOWN_PROCESS = 0; 20 BROWSER_PROCESS = 1; 21 RENDERER_PROCESS = 2; 22 GPU_PROCESS = 3; 23 UTILITY_PROCESS = 4; 24 ZYGOTE_PROCESS = 5; 25 SANDBOX_HELPER_PROCESS = 6; 26 PPAPI_PLUGIN_PROCESS = 7; 27 PPAPI_BROKER_PROCESS = 8; 28 NETWORK_SERVICE_PROCESS = 10; 29 30 // A Chrome process not identified by any other enum. Defined for the benefit 31 // of Chrome OS. Do not use for the Chrome sampling profiler; define a new 32 // enum instead. 33 OTHER_PROCESS = 9; 34} 35 36// Chrome thread. This list is not exhaustive. 37enum Thread { 38 UNKNOWN_THREAD = 0; 39 40 // The 'main thread' in various processes. In browser process, this is 41 // sometimes also called the 'ui thread'. 42 MAIN_THREAD = 1; 43 FILE_THREAD = 2; // Deprecated. 44 FILE_USER_BLOCKING_THREAD = 3; // Deprecated. 45 PROCESS_LAUNCHER_THREAD = 4; // Deprecated. 46 CACHE_THREAD = 5; // Deprecated. 47 IO_THREAD = 6; 48 DB_THREAD = 7; // Deprecated. 49 GPU_MAIN_THREAD = 8; // Deprecated. 50 RENDER_THREAD = 9; // Deprecated. 51 UTILITY_THREAD = 10; // Deprecated. 52 53 // Compositor thread (can be in both renderer and gpu processes). 54 COMPOSITOR_THREAD = 11; 55 56 // Task scheduler thread. 57 SCHEDULER_WORKER_THREAD = 13; 58 COMPOSITOR_TILE_WORKER_THREAD = 14; 59 SERVICE_WORKER_THREAD = 15; 60 61 // DedicatedWorker thread in the renderer process. 62 DEDICATED_WORKER_THREAD = 18; 63 64 // Thread pool thread (can be in different Chrome processes). 65 THREAD_POOL_THREAD = 16; 66 67 // GPU memory thread (in renderer process). 68 GPU_MEMORY_THREAD = 17; 69 70 // The thread for Chrome memory tracing (can be in different processes). 71 MEMORY_INFRA_THREAD = 19; 72 73 // Media thread (in renderer process). 74 MEDIA_THREAD = 20; 75 76 // WebRTC threads, e.g. WebRTC_Signaling,WebRTC_Network (in renderer process). 77 WEBRTC_THREAD = 21; 78 79 // DRM threads (in GPU process). 80 DRM_THREAD = 22; 81 82 // Audio device threads (in renderer process), a worker thread type used to 83 // transfer data between the browser and the renderer process. 84 AUDIO_DEVICE_THREAD = 23; 85 86 // Audio threads that are not in the renderer processes. 87 AUDIO_THREAD = 24; 88 89 // Dav1d worker threads (in renderer process), which runs the AV1 codec. 90 DAV1D_WORKER_THREAD = 25; 91 92 // Stack sampling profiler uses this thread to periodically stop a thread 93 // and get stack execution information. 94 // Spawned at 95 // https://source.chromium.org/chromium/chromium/src/+/main:base/profiler/stack_sampling_profiler.cc;l=379;drc=ada6c70d141251b40840a6cab657737bf63eed9d. 96 STACK_SAMPLING_THREAD = 26; 97 98 // Used for batching frames for video streams. 99 // Spawned at 100 // https://source.chromium.org/chromium/chromium/src/+/main:content/renderer/renderer_blink_platform_impl.cc;l=988;drc=7172fffc3c545134d5c88af8ab07b04fcb1d628e. 101 VIDEO_FRAME_COMPOSITOR_THREAD = 27; 102 103 // Display Compositor thread (in GPU process). 104 DISPLAY_COMPOSITOR_THREAD = 28; 105 106 // Codec worker thread. 107 // Spawned at 108 // https://source.chromium.org/chromium/chromium/src/+/main:media/base/codec_worker_impl.h;drc=923a33e9d5e24f4fb64f40dd2ffc182b2de93b0f;l=41. 109 CODEC_WORKER_THREAD = 29; 110 111 // A Chrome thread not identified by any other enum. Defined for the benefit 112 // of Chrome OS. Do not use for the Chrome sampling profiler; define a new 113 // enum instead. 114 OTHER_THREAD = 12; 115} 116 117// Process phases, or where in the lifetime of the process it is such as 118// startup, normal operation, shutdown, etc. These don't necessarily occur in 119// the order defined here so it's fine to add new ones to further segregrate 120// the lifetime of a process. 121enum ProcessPhase { 122 // The browser's main message loop has been started. 123 // Based on histogram Startup.MessageLoopStartTime 124 MAIN_LOOP_START = 0; 125 126 // The beginning of navigation in the first web contents' main frame. 127 // Based on histogram Startup.FirstWebContents.MainNavigationStart 128 MAIN_NAVIGATION_START = 1; 129 130 // The navigation is committed (first bytes received) in the first web 131 // contents' main frame. 132 // Based on histogram Startup.FirstWebContents.MainNavigationFinished 133 MAIN_NAVIGATION_FINISHED = 2; 134 135 // First non-empty paint of the first web contents. 136 // Based on histogram Startup.FirstWebContents.NonEmptyPaint2 137 FIRST_NONEMPTY_PAINT = 3; 138 139 // Process shutdown has begun. 140 SHUTDOWN_START = 4; 141} 142