Chromium Code Reviews| Index: components/crash/content/app/crashpad_win.cc |
| diff --git a/components/crash/content/app/crashpad_win.cc b/components/crash/content/app/crashpad_win.cc |
| index fa50b012bc755f7ce2d1fcbd1df39be759da60dc..c1b5e891a0c5037af33d226ec6151349f1a689f2 100644 |
| --- a/components/crash/content/app/crashpad_win.cc |
| +++ b/components/crash/content/app/crashpad_win.cc |
| @@ -35,7 +35,14 @@ void GetPlatformCrashpadAnnotations( |
| exe_file, &product_name, &version, &special_build, &channel_name); |
| (*annotations)["prod"] = base::UTF16ToUTF8(product_name); |
| (*annotations)["ver"] = base::UTF16ToUTF8(version); |
| - (*annotations)["channel"] = base::UTF16ToUTF8(channel_name); |
| +#if defined(GOOGLE_CHROME_BUILD) |
| + // Empty means stable. |
| + const bool allow_empty_channel = true; |
| +#else |
| + const bool allow_empty_channel = false; |
| +#endif |
| + if (allow_empty_channel || !channel_name.empty()) |
| + (*annotations)["channel"] = base::UTF16ToUTF8(channel_name); |
| if (!special_build.empty()) |
| (*annotations)["special"] = base::UTF16ToUTF8(special_build); |
| #if defined(ARCH_CPU_X86) |
| @@ -96,18 +103,34 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, |
| // If the handler is embedded in the binary (e.g. chrome, setup), we |
| // reinvoke it with --type=crashpad-handler. Otherwise, we use the |
| // standalone crashpad_handler.exe (for tests, etc.). |
| - std::vector<std::string> arguments; |
| + std::vector<std::string> start_arguments; |
| if (embedded_handler) { |
| - arguments.push_back(std::string("--type=") + switches::kCrashpadHandler); |
| + start_arguments.push_back(std::string("--type=") + |
| + switches::kCrashpadHandler); |
| // The prefetch argument added here has to be documented in |
| // chrome_switches.cc, below the kPrefetchArgument* constants. A constant |
| // can't be used here because crashpad can't depend on Chrome. |
| - arguments.push_back("/prefetch:7"); |
| + start_arguments.push_back("/prefetch:7"); |
| } else { |
| base::FilePath exe_dir = exe_file.DirName(); |
| exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe")); |
| } |
| + std::vector<std::string> arguments(start_arguments); |
| + |
| + if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) { |
| + arguments.push_back("--monitor-self"); |
| + for (const std::string& start_argument : start_arguments) { |
| + arguments.push_back(std::string("--monitor-self-argument=") + |
| + start_argument); |
| + } |
| + } |
| + |
| + // Set up --monitor-self-annotation even in the absence of --monitor-self so |
| + // that minidumps produced by generate_dump will contain these annotations. |
|
scottmg
2017/04/10 17:09:31
A little questionable here since there's no genera
Mark Mentovai
2017/04/10 17:19:02
scottmg wrote:
scottmg
2017/04/10 18:05:45
Huh! I didn't remember porting it. For some reason
|
| + arguments.push_back(std::string("--monitor-self-annotation=ptype=") + |
| + switches::kCrashpadHandler); |
| + |
| GetCrashpadClient().StartHandler(exe_file, database_path, metrics_path, url, |
| process_annotations, arguments, false, |
| false); |