DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
/* This file was autogenerated by toolkit/crashreporter/generate_crash_reporter_sources.py. DO NOT EDIT */

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef CrashAnnotations_h
#define CrashAnnotations_h

#include <cstdint>

namespace CrashReporter {

// Typed enum representing all crash annotations
enum class Annotation : uint32_t {
  A11yHandlerRegistered = 0,
  AbortMessage = 1,
  Accessibility = 2,
  AccessibilityClient = 3,
  AccessibilityInProcClient = 4,
  ActualStreamLen = 5,
  AdapterDeviceID = 6,
  AdapterDriverVersion = 7,
  AdapterSubsysID = 8,
  AdapterVendorID = 9,
  Addons = 10,
  AppInitDLLs = 11,
  AsyncShutdownModule = 12,
  AsyncShutdownTimeout = 13,
  AvailablePageFile = 14,
  AvailablePhysicalMemory = 15,
  AvailableVirtualMemory = 16,
  BIOS_Manufacturer = 17,
  BlockedDllList = 18,
  BlocklistInitFailed = 19,
  BreakpadReserveAddress = 20,
  BreakpadReserveSize = 21,
  BuildID = 22,
  CPUMicrocodeVersion = 23,
  ClassRegistrationInfoChild = 24,
  ClassRegistrationInfoParent = 25,
  CoMarshalInterfaceFailure = 26,
  CoUnmarshalInterfaceResult = 27,
  ContainsMemoryReport = 28,
  ContentSandboxCapabilities = 29,
  ContentSandboxCapable = 30,
  ContentSandboxEnabled = 31,
  ContentSandboxLevel = 32,
  CpuUsageFlashProcess1 = 33,
  CpuUsageFlashProcess2 = 34,
  CrashAddressLikelyWrong = 35,
  CrashTime = 36,
  CreateStreamOnHGlobalFailure = 37,
  CycleCollector = 38,
  DOMIPCEnabled = 39,
  DeviceResetReason = 40,
  EMCheckCompatibility = 41,
  EventLoopNestingLevel = 42,
  ExpectedStreamLen = 43,
  FlashProcessDump = 44,
  FramePoisonBase = 45,
  FramePoisonSize = 46,
  GMPLibraryPath = 47,
  GMPPlugin = 48,
  GPUProcessLaunchCount = 49,
  GPUProcessStatus = 50,
  GetHGlobalFromStreamFailure = 51,
  GraphicsCriticalError = 52,
  GraphicsSanityTest = 53,
  GraphicsStartupTest = 54,
  HangMonitorDescription = 55,
  HasDeviceTouchScreen = 56,
  IAccessibleConfig = 57,
  IPCFatalErrorMsg = 58,
  IPCFatalErrorProtocol = 59,
  IPCMessageName = 60,
  IPCMessageSize = 61,
  IPCReadErrorReason = 62,
  IPCShutdownState = 63,
  IPCSystemError = 64,
  IPCTransportFailureReason = 65,
  InstallTime = 66,
  InterfaceRegistrationInfoChild = 67,
  InterfaceRegistrationInfoParent = 68,
  IpcCreateEndpointsNsresult = 69,
  IpcCreatePipeCloExecErrno = 70,
  IpcCreatePipeFcntlErrno = 71,
  IpcCreatePipeSocketPairErrno = 72,
  IpcCreateTransportDupErrno = 73,
  IsGarbageCollecting = 74,
  JSLargeAllocationFailure = 75,
  JSOutOfMemory = 76,
  JavaStackTrace = 77,
  LowCommitSpaceEvents = 78,
  MarshalActCtxManifestPath = 79,
  MozCrashReason = 80,
  Notes = 81,
  NumberOfProcessors = 82,
  OOMAllocationSize = 83,
  PluginCpuUsage = 84,
  PluginFilename = 85,
  PluginHang = 86,
  PluginHangUIDuration = 87,
  PluginName = 88,
  PluginVersion = 89,
  ProcessType = 90,
  ProductID = 91,
  ProductName = 92,
  ProxyStreamSize = 93,
  ProxyStreamSizeFrom = 94,
  ProxyStreamUnmarshalStatus = 95,
  ProxyStreamValid = 96,
  RecordReplayError = 97,
  RecordReplayHang = 98,
  ReleaseChannel = 99,
  RemoteType = 100,
  SafeMode = 101,
  SecondsSinceLastCrash = 102,
  ServerURL = 103,
  SheetLoadFailure = 104,
  ShutdownProgress = 105,
  StartupCrash = 106,
  StartupTime = 107,
  StatFailure = 108,
  StorageConnectionNotClosed = 109,
  SystemMemoryUsePercentage = 110,
  TelemetryClientId = 111,
  TelemetryEnvironment = 112,
  TelemetryServerURL = 113,
  TelemetrySessionId = 114,
  TestKey = 115,
  TestUnicode = 116,
  TextureUsage = 117,
  ThreadIdNameMapping = 118,
  TotalPageFile = 119,
  TotalPhysicalMemory = 120,
  TotalVirtualMemory = 121,
  URL = 122,
  UnknownNetAddrSocketFamily = 123,
  UnmarshalActCtx = 124,
  UnmarshalActCtxManifestPath = 125,
  UptimeTS = 126,
  User32BeforeBlocklist = 127,
  Vendor = 128,
  Version = 129,
  Winsock_LSP = 130,
  additional_minidumps = 131,
  ipc_channel_error = 132,
  nsAsyncShutdownComponent = 133,
  useragent_locale = 134,
  Count = 135
};

// Stringified crash annotation names
const char* const kAnnotationStrings[] = {
  "A11yHandlerRegistered",
  "AbortMessage",
  "Accessibility",
  "AccessibilityClient",
  "AccessibilityInProcClient",
  "ActualStreamLen",
  "AdapterDeviceID",
  "AdapterDriverVersion",
  "AdapterSubsysID",
  "AdapterVendorID",
  "Add-ons",
  "AppInitDLLs",
  "AsyncShutdownModule",
  "AsyncShutdownTimeout",
  "AvailablePageFile",
  "AvailablePhysicalMemory",
  "AvailableVirtualMemory",
  "BIOS_Manufacturer",
  "BlockedDllList",
  "BlocklistInitFailed",
  "BreakpadReserveAddress",
  "BreakpadReserveSize",
  "BuildID",
  "CPUMicrocodeVersion",
  "ClassRegistrationInfoChild",
  "ClassRegistrationInfoParent",
  "CoMarshalInterfaceFailure",
  "CoUnmarshalInterfaceResult",
  "ContainsMemoryReport",
  "ContentSandboxCapabilities",
  "ContentSandboxCapable",
  "ContentSandboxEnabled",
  "ContentSandboxLevel",
  "CpuUsageFlashProcess1",
  "CpuUsageFlashProcess2",
  "CrashAddressLikelyWrong",
  "CrashTime",
  "CreateStreamOnHGlobalFailure",
  "CycleCollector",
  "DOMIPCEnabled",
  "DeviceResetReason",
  "EMCheckCompatibility",
  "EventLoopNestingLevel",
  "ExpectedStreamLen",
  "FlashProcessDump",
  "FramePoisonBase",
  "FramePoisonSize",
  "GMPLibraryPath",
  "GMPPlugin",
  "GPUProcessLaunchCount",
  "GPUProcessStatus",
  "GetHGlobalFromStreamFailure",
  "GraphicsCriticalError",
  "GraphicsSanityTest",
  "GraphicsStartupTest",
  "HangMonitorDescription",
  "HasDeviceTouchScreen",
  "IAccessibleConfig",
  "IPCFatalErrorMsg",
  "IPCFatalErrorProtocol",
  "IPCMessageName",
  "IPCMessageSize",
  "IPCReadErrorReason",
  "IPCShutdownState",
  "IPCSystemError",
  "IPCTransportFailureReason",
  "InstallTime",
  "InterfaceRegistrationInfoChild",
  "InterfaceRegistrationInfoParent",
  "IpcCreateEndpointsNsresult",
  "IpcCreatePipeCloExecErrno",
  "IpcCreatePipeFcntlErrno",
  "IpcCreatePipeSocketPairErrno",
  "IpcCreateTransportDupErrno",
  "IsGarbageCollecting",
  "JSLargeAllocationFailure",
  "JSOutOfMemory",
  "JavaStackTrace",
  "LowCommitSpaceEvents",
  "MarshalActCtxManifestPath",
  "MozCrashReason",
  "Notes",
  "NumberOfProcessors",
  "OOMAllocationSize",
  "PluginCpuUsage",
  "PluginFilename",
  "PluginHang",
  "PluginHangUIDuration",
  "PluginName",
  "PluginVersion",
  "ProcessType",
  "ProductID",
  "ProductName",
  "ProxyStreamSize",
  "ProxyStreamSizeFrom",
  "ProxyStreamUnmarshalStatus",
  "ProxyStreamValid",
  "RecordReplayError",
  "RecordReplayHang",
  "ReleaseChannel",
  "RemoteType",
  "SafeMode",
  "SecondsSinceLastCrash",
  "ServerURL",
  "SheetLoadFailure",
  "ShutdownProgress",
  "StartupCrash",
  "StartupTime",
  "StatFailure",
  "StorageConnectionNotClosed",
  "SystemMemoryUsePercentage",
  "TelemetryClientId",
  "TelemetryEnvironment",
  "TelemetryServerURL",
  "TelemetrySessionId",
  "TestKey",
  "TestUnicode",
  "TextureUsage",
  "ThreadIdNameMapping",
  "TotalPageFile",
  "TotalPhysicalMemory",
  "TotalVirtualMemory",
  "URL",
  "UnknownNetAddrSocketFamily",
  "UnmarshalActCtx",
  "UnmarshalActCtxManifestPath",
  "UptimeTS",
  "User32BeforeBlocklist",
  "Vendor",
  "Version",
  "Winsock_LSP",
  "additional_minidumps",
  "ipc_channel_error",
  "nsAsyncShutdownComponent",
  "useragent_locale"
};

// Whitelist of crash annotations that can be included in a crash ping
const Annotation kCrashPingWhitelist[] = {
  Annotation::AsyncShutdownTimeout,
  Annotation::AvailablePageFile,
  Annotation::AvailablePhysicalMemory,
  Annotation::AvailableVirtualMemory,
  Annotation::BlockedDllList,
  Annotation::BlocklistInitFailed,
  Annotation::BuildID,
  Annotation::ContainsMemoryReport,
  Annotation::CrashTime,
  Annotation::EventLoopNestingLevel,
  Annotation::IsGarbageCollecting,
  Annotation::LowCommitSpaceEvents,
  Annotation::MozCrashReason,
  Annotation::OOMAllocationSize,
  Annotation::ProductID,
  Annotation::ProductName,
  Annotation::ReleaseChannel,
  Annotation::RemoteType,
  Annotation::SecondsSinceLastCrash,
  Annotation::ShutdownProgress,
  Annotation::StartupCrash,
  Annotation::SystemMemoryUsePercentage,
  Annotation::TextureUsage,
  Annotation::TotalPageFile,
  Annotation::TotalPhysicalMemory,
  Annotation::TotalVirtualMemory,
  Annotation::UptimeTS,
  Annotation::User32BeforeBlocklist,
  Annotation::ipc_channel_error
};

// Blacklist of crash annotations that shouldn't be read from a content process
const Annotation kContentProcessBlacklist[] = {
  Annotation::FramePoisonBase,
  Annotation::FramePoisonSize,
  Annotation::StartupCrash,
  Annotation::StartupTime,
  Annotation::URL
};

/**
 * Return the string representation of a crash annotation.
 *
 * @param aAnnotation a crash annotation
 * @returns A constant string holding the annotation name
 */
static inline const char*
AnnotationToString(Annotation aAnnotation) {
  return kAnnotationStrings[static_cast<uint32_t>(aAnnotation)];
}

/**
 * Converts a string to its corresponding crash annotation.
 *
 * @param aResult a reference where the annotation will be stored
 * @param aValue the string to be converted
 * @return true if the string was successfully converted, false if it did not
 *         correspond to any known annotation
 */
bool AnnotationFromString(Annotation& aResult, const char* aValue);

/**
 * Checks if the given crash annotation is whitelisted for inclusion in the
 * crash ping.
 *
 * @param aAnnotation the crash annotation to be checked
 * @return true if the annotation can be included in the crash ping, false
 *         otherwise
 */
bool IsAnnotationWhitelistedForPing(Annotation aAnnotation);

/**
 * Checks if the given crash annotation needs to be filtered out when reading
 * a content process crash annotations. Blacklisted annotations will be
 * replaced with ones provided by the parent process.
 *
 * @param aAnnotation the crash annotation to be checked
 * @return true if the annotation needs to be filtered out when reading
 *         annotations provided by a content process, false otherwise
 */
bool IsAnnotationBlacklistedForContent(Annotation aAnnotation);

} // namespace CrashReporter

#endif // CrashAnnotations_h