1// Copyright 2020 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 7import public "protos/perfetto/trace/track_event/track_event.proto"; 8 9package perfetto.protos; 10 11enum ChromeAppState { 12 APP_STATE_FOREGROUND = 1; 13 APP_STATE_BACKGROUND = 2; 14} 15 16enum MemoryPressureLevel { 17 MEMORY_PRESSURE_LEVEL_NONE = 0; 18 MEMORY_PRESSURE_LEVEL_MODERATE = 1; 19 MEMORY_PRESSURE_LEVEL_CRITICAL = 2; 20} 21 22message ChromeMemoryPressureNotification { 23 optional MemoryPressureLevel level = 1; 24 25 // ID of interned source location where MemoryPressureListener was created 26 optional uint64 creation_location_iid = 2; 27} 28 29message ChromeTaskAnnotator { 30 optional uint32 ipc_hash = 1; 31} 32 33message ChromeBrowserContext { 34 optional fixed64 ptr = 1; 35} 36 37message ChromeProfileDestroyer { 38 optional fixed64 profile_ptr = 1; 39 optional bool is_off_the_record = 2; 40 optional string otr_profile_id = 3; 41 optional uint32 host_count_at_creation = 4; 42 optional uint32 host_count_at_destruction = 5; 43 optional fixed64 render_process_host_ptr = 6; 44} 45 46message ChromeTaskPostedToDisabledQueue { 47 optional string task_queue_name = 1; 48 optional uint64 time_since_disabled_ms = 2; 49 optional uint32 ipc_hash = 3; 50 optional uint64 source_location_iid = 4; 51} 52 53message ChromeRasterTask { 54 optional int64 source_frame_number = 1; 55} 56 57message ChromeMessagePumpForUI { 58 // The MSG defined in winuser.h. 59 optional uint32 message_id = 1; 60} 61 62// An enumeration specifying the reason of the RenderFrame deletion. 63// This is copied from content/common/frame.mojom. 64enum FrameDeleteIntention { 65 // The frame being deleted isn't a (speculative) main frame. 66 FRAME_DELETE_INTENTION_NOT_MAIN_FRAME = 0; 67 68 // The frame being deleted is a speculative main frame, and it is being 69 // deleted as part of the shutdown for that WebContents. The entire RenderView 70 // etc will be destroyed by a separate IPC sent later. 71 FRAME_DELETE_INTENTION_SPECULATIVE_MAIN_FRAME_FOR_SHUTDOWN = 1; 72 73 // The frame being deleted is a speculative main frame, and it is being 74 // deleted because the speculative navigation was cancelled. This is not part 75 // of shutdown. 76 FRAME_DELETE_INTENTION_SPECULATIVE_MAIN_FRAME_FOR_NAVIGATION_CANCELLED = 2; 77} 78 79message RenderFrameImplDeletion { 80 // The intent for the deletion. 81 optional FrameDeleteIntention intent = 1; 82 83 // Whether the frame that's about to be deleted has a pending navigation 84 // commit. 85 optional bool has_pending_commit = 2; 86 87 // Whether the frame that's about to be deleted has a pending cross-document 88 // navigation commit. 89 optional bool has_pending_cross_document_commit = 3; 90 91 // The FrameTreeNode ID of the frame that's about to be deleted. 92 optional uint64 frame_tree_node_id = 4; 93} 94 95enum ShouldSwapBrowsingInstance { 96 // No BrowsingInstance swap. 97 SHOULD_SWAP_BROWSING_INSTANCE_NO = 0; 98 99 // Forced BrowsingInstance swap. 100 SHOULD_SWAP_BROWSING_INSTANCE_YES_FORCE_SWAP = 1; 101 102 // Proactive BrowsingInstance swap for cross-site navigation. 103 SHOULD_SWAP_BROWSING_INSTANCE_YES_CROSS_SITE_PROACTIVE_SWAP = 2; 104 105 // Proactive BrowsingInstance swap for same-site navigation. 106 SHOULD_SWAP_BROWSING_INSTANCE_YES_SAME_SITE_PROACTIVE_SWAP = 3; 107} 108 109message ShouldSwapBrowsingInstancesResult { 110 // The FrameTreeNode ID. 111 optional uint64 frame_tree_node_id = 1; 112 113 // Whether a navigation will do a BrowsingInstance swap or not. 114 optional ShouldSwapBrowsingInstance result = 2; 115} 116 117message FrameTreeNodeInfo { 118 // The FrameTreeNode ID. 119 optional uint64 frame_tree_node_id = 1; 120 121 // Whether the frame is a main frame or not. 122 optional bool is_main_frame = 2; 123 124 // Whether there's a speculative RenderFrameHost or not. 125 optional bool has_speculative_render_frame_host = 3; 126} 127 128message ChromeHashedPerformanceMark { 129 optional uint32 site_hash = 1; 130 optional string site = 2; 131 optional uint32 mark_hash = 3; 132 optional string mark = 4; 133} 134 135message ChromeTrackEvent { 136 // Extension range for Chrome: 1000-1999 137 // Next ID: 1012 138 extend TrackEvent { 139 optional ChromeAppState chrome_app_state = 1000; 140 141 optional ChromeMemoryPressureNotification 142 chrome_memory_pressure_notification = 1001; 143 144 optional ChromeTaskAnnotator chrome_task_annotator = 1002; 145 146 optional ChromeBrowserContext chrome_browser_context = 1003; 147 148 optional ChromeProfileDestroyer chrome_profile_destroyer = 1004; 149 150 optional ChromeTaskPostedToDisabledQueue 151 chrome_task_posted_to_disabled_queue = 1005; 152 153 optional ChromeRasterTask chrome_raster_task = 1006; 154 155 optional ChromeMessagePumpForUI chrome_message_pump_for_ui = 1007; 156 157 optional RenderFrameImplDeletion render_frame_impl_deletion = 1008; 158 159 optional ShouldSwapBrowsingInstancesResult 160 should_swap_browsing_instances_result = 1009; 161 162 optional FrameTreeNodeInfo frame_tree_node_info = 1010; 163 164 optional ChromeHashedPerformanceMark chrome_hashed_performance_mark = 1011; 165 } 166} 167