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

Unified Diff: base/threading/platform_thread_win.cc

Issue 7495031: trace_event support for thread names (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove process names. With thread names, they are redundant. Created 9 years, 5 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
Index: base/threading/platform_thread_win.cc
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index 56d73811c0fc5fd63e0f6d76a606306d4ad4669b..064dd9bb06a35fe9f1f70220163f55b5cb15b780 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/threading/thread_restrictions.h"
#include "base/win/windows_version.h"
+#include "base/debug/trace_event.h"
namespace base {
@@ -94,6 +95,7 @@ void PlatformThread::Sleep(int duration_ms) {
// static
void PlatformThread::SetName(const char* name) {
+ base::debug::TraceLog::GetInstance()->SetCurrentThreadName(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())

Powered by Google App Engine
This is Rietveld 408576698