Commit eae7ecf7 authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Name the crashpad handler thread

Thread names are great in general. They are specifically good when doing
multi-process debugging because the names of the main threads are the
best clue as to which process is which. The crashpad handler threads
were notably missing names in a recent debugging session. This fixes
that.

This is being done in Windows specific Chromium code because that is
where the benefit is greatest and because crashpad doesn't have a
function to set thread names.

Bug: 1004991
Change-Id: Id7163852c3a609856fc50b30932a313e3dd34a8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808450Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697744}
parent 962a30cc
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/platform_thread.h"
#include "components/browser_watcher/stability_report_user_stream_data_source.h" #include "components/browser_watcher/stability_report_user_stream_data_source.h"
#include "components/gwp_asan/buildflags/buildflags.h" #include "components/gwp_asan/buildflags/buildflags.h"
#include "third_party/crashpad/crashpad/client/crashpad_info.h" #include "third_party/crashpad/crashpad/client/crashpad_info.h"
...@@ -36,6 +37,8 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line, ...@@ -36,6 +37,8 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line,
// processes. // processes.
base::EnableTerminationOnOutOfMemory(); base::EnableTerminationOnOutOfMemory();
base::PlatformThread::SetName("CrashpadMainThread");
// If the handler is started with --monitor-self, it'll need a ptype // If the handler is started with --monitor-self, it'll need a ptype
// annotation set. It'll normally set one itself by being invoked with // annotation set. It'll normally set one itself by being invoked with
// --monitor-self-annotation=ptype=crashpad-handler, but that leaves a window // --monitor-self-annotation=ptype=crashpad-handler, but that leaves a window
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment