| 565 | } // namespace |
| 566 | |
| 567 | int HandlerMain(int argc, |
| 568 | char* argv[], |
| 569 | const UserStreamDataSources* user_stream_sources) { |
| 570 | InitCrashpadLogging(); |
| 571 | |
| 572 | InstallCrashHandler(); |
| 573 | CallMetricsRecordNormalExit metrics_record_normal_exit; |
| 574 | |
| 575 | const base::FilePath argv0( |
| 576 | ToolSupport::CommandLineArgumentToFilePathStringType(argv[0])); |
| 577 | const base::FilePath me(argv0.BaseName()); |
| 578 | |
| 579 | enum OptionFlags { |
| 580 | // Long options without short equivalents. |
| 581 | kOptionLastChar = 255, |
| 582 | kOptionAnnotation, |
| 583 | #if defined(ATTACHMENTS_SUPPORTED) |
| 584 | kOptionAttachment, |
| 585 | #endif // defined(ATTACHMENTS_SUPPORTED) |
| 586 | kOptionDatabase, |
| 587 | #if BUILDFLAG(IS_APPLE) |
| 588 | kOptionHandshakeFD, |
| 589 | #endif // BUILDFLAG(IS_APPLE) |
| 590 | #if BUILDFLAG(IS_WIN) |
| 591 | kOptionInitialClientData, |
| 592 | #endif // BUILDFLAG(IS_WIN) |
| 593 | #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) |
| 594 | kOptionInitialClientFD, |
| 595 | #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || |
| 596 | // BUILDFLAG(IS_CHROMEOS) |
| 597 | #if BUILDFLAG(IS_APPLE) |
| 598 | kOptionMachService, |
| 599 | #endif // BUILDFLAG(IS_APPLE) |
| 600 | kOptionMetrics, |
| 601 | kOptionMonitorSelf, |
| 602 | kOptionMonitorSelfAnnotation, |
| 603 | kOptionMonitorSelfArgument, |
| 604 | kOptionNoIdentifyClientViaUrl, |
| 605 | kOptionNoPeriodicTasks, |
| 606 | kOptionNoRateLimit, |
| 607 | kOptionNoUploadGzip, |
| 608 | #if BUILDFLAG(IS_ANDROID) |
| 609 | kOptionNoWriteMinidumpToDatabase, |
| 610 | #endif // BUILDFLAG(IS_ANDROID) |
| 611 | #if BUILDFLAG(IS_WIN) |
| 612 | kOptionPipeName, |
| 613 | #endif // BUILDFLAG(IS_WIN) |
| 614 | #if BUILDFLAG(IS_APPLE) |
| 615 | kOptionResetOwnCrashExceptionPortToSystemDefault, |
| 616 | #endif // BUILDFLAG(IS_APPLE) |
| 617 | #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) |
| 618 | kOptionSanitizationInformation, |
| 619 | kOptionSharedClientConnection, |
| 620 | kOptionTraceParentWithException, |
| 621 | #endif |
| 622 | kOptionURL, |
| 623 | #if BUILDFLAG(IS_CHROMEOS) |
| 624 | kOptionUseCrosCrashReporter, |