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

Unified Diff: base/threading/platform_thread_win.cc

Issue 11438022: Add ability to retrieve a thread_name given a thread_id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move the set to PlatformThread::SetName so we catch any name changes. Created 8 years 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 82981adaf834b7a813cabf40756f4c2d59222ac5..25b96cc5ca075d04609cf684d7bf3fdac730dca9 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -7,6 +7,7 @@
#include "base/debug/alias.h"
#include "base/debug/profiler.h"
#include "base/logging.h"
+#include "base/threading/thread_id_name_manager.h"
#include "base/threading/thread_local.h"
#include "base/threading/thread_restrictions.h"
#include "base/tracked_objects.h"
@@ -118,6 +119,8 @@ void PlatformThread::Sleep(TimeDelta duration) {
void PlatformThread::SetName(const char* name) {
current_thread_name.Set(const_cast<char*>(name));
+ ThreadIdNameManager::GetInstance()->SetNameForId(CurrentId(), name);
+
// On Windows only, we don't need to tell the profiler about the "BrokerEvent"
// thread, as it exists only in the chrome.exe image, and never spawns or runs
// tasks (items which could be profiled). This test avoids the notification,

Powered by Google App Engine
This is Rietveld 408576698