Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: base/threading/platform_thread_win.cc

Issue 10454076: Signal thread names in instrumented binaries, even when a debugger is not attached. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Jim's comments. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« base/debug/profiler.cc ('K') | « base/debug/profiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_win.cc
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index bd4282f68ca7f4218667f9ef9806a8a7332855f9..4dc839bbc7e224a907c9b3209b9b80cdaa7243ba 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -5,6 +5,7 @@
#include "base/threading/platform_thread.h"
#include "base/debug/alias.h"
+#include "base/debug/profiler.h"
#include "base/logging.h"
#include "base/threading/thread_local.h"
#include "base/threading/thread_restrictions.h"
@@ -133,7 +134,9 @@ void PlatformThread::SetName(const char* name) {
// The debugger needs to be around to catch the name in the exception. If
// there isn't a debugger, we are just needlessly throwing an exception.
- if (!::IsDebuggerPresent())
+ // If this image file is instrumented, we raise the exception anyway
+ // to provide the profiler with human-readable thread names.
+ if (!::IsDebuggerPresent() && !base::debug::IsBinaryInstrumented())
return;
SetNameInternal(CurrentId(), name);
« base/debug/profiler.cc ('K') | « base/debug/profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698